1

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.

  • See man notify-send for clarification on what the alias alert is for. Similarly man ls will provide clues to what thel, la, ll aliases do. – Elder Geek Nov 9 '16 at 3:39
  • 5
    Possible duplicate of Use of default alias "alert" – muru Nov 9 '16 at 3:41
  • Just for fun try alert FreeBeer ;) – Elder Geek Nov 9 '16 at 3:44
  • Are you using this on the GUI? – muru Nov 9 '16 at 3:57
  • 2
    There's no "of course" about it. The alias doesn't seem to be working for you, so now it's a question of debugging it. Then you don't assume anything. As to what it does and how it does what it does, that's adequately explained in the other question. – muru Nov 9 '16 at 4:02
1

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.

  • actually the first attempt was "Help Me~~~~" but that didn't work either. As in comment above it was because TV was maximized with "always on top" option, and "normalizing" the window allowed the notification bubble to appear. I did upvote your "How to backup a desktop PC" answer for all your hard work on this topic. Thank you! – WinEunuuchs2Unix Nov 9 '16 at 4:12
  • No worries, I enjoyed it! – Elder Geek Nov 9 '16 at 4:12
  • 1
    A single quote inside double quotes is literal. E.g. run echo "It's" – wjandrea Nov 9 '16 at 4:25
  • @wjandrea That's true. I'm not sure why I wasn't alert enough to catch that. ;-) – Elder Geek Nov 9 '16 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.