Ubuntu – Something has set up an alias I don’t understand “alert”

alias

When I type in the command alias I get some funny things I don't understand:

rick@dell:~$ alias
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'

The first command / alias seems to do nothing when I type:

rick@dell:~$ alert "It's raining"

How, where, when and why is this alert command supposed to be used in an alias?


Duplicate close thoughts:

The proposed duplicate explains alert alias to great extent but doesn't explain why typing Alert "It's raining" does NOT result in a notification bubble.

The question above does ask for complete explanation though which the CV duplicate satisfied.

A day after the above question was posted a new Question with "provide your own Answer" option was posted here: (notify-send (alert) not popping-up GUI bubble messages) and it solves the reason for posting the above question in the first place.

The above CV candidate question can almost be considered "too broad" because it is seeking advice about aliases AND ~/.bashrc AND notify-send.

I have voted to close this question as a duplicate too.

Best Answer

There's an unclosed quote in It's raining. bash is waiting for you to close the quote behind the scenes so it appears it's not working. Try a single word without an apostrophe or even "CamelCase" or close the quote like alert It's raining'

Another possibility that might make you think the alert alias isn't working is a window with the always-on-top modifier over the upper right quadrant of your desktop.

Related Question