Little Girl's Mostly Linux Blog

BeepAtMe

Beep at me

 

This page was last updated on October 9, 2011.

 

Any of these methods may work to get a script to beep at you at whatever point you insert the command:
echo $"\a"
Or:
echo $'\a'
Or:
echo "\a"
Or:
echo '\a'
Or:
echo -e "\a"
Or:
echo -e '\a'
Or:
printf "\a"
Or:
printf '\a'

Non-printing beeps

If you want to create a log file to show the script output as it runs, you could use a command like this:
bash scriptname | tee -a logfilename
You may want to send the beep only to the terminal so tee doesn’t log it in the text file. You can do this by adding either > /dev/tty or >&2 to the commands above. For example:
echo -e '\a' > /dev/tty
Or:
echo -e '\a' >&2


Obligatory Happy Ending

And they all lived happily ever after. The end.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Comment:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: