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.
Comment: