I want to get a BASH terminal flashing. The goal is to get the terminal to flash between two colours, say white and black, substantially, using standard Linux utilities. I don't mind if the terminal is filled with characters and cleared in order to do this. A rough picture of what this could look like is as follows:
A Bash Terminal is a terminal that has been set to use the Bash Shell. Shell scripts are commands that are in the order in which they are to be executed. They are text files that use the .sh extension and are used to perform operations involving file manipulation, program execution, and text printing.
Probably the simplest one is to add call to your script at the end of .bashrc file, as stated in the comment. However, this will cause your script run not only when a terminal starts up, but also when you for example log in to the text console (reachable by pressing Ctrl+Alt+F4 for example), or when you log in remotely via ssh.
It can be enabled on major terminal emulators like xterm (Ctrl + middle button menu) or putty ( Settings/Terminal/Bell). Unfortunately, there is no general way to do it. But once it has been done, echo Ctrl+G causes the terminal to flash instead of beeping.
Instead, the commands it invokes as part of the script will each individually write output and flush whenever they feel like it. So your question is really how to force the commands within the bash script to flush, and that depends on what they are. Show activity on this post. You can use tee to write to the file without the need for flushing.
You can toggle between normal and reverse video with the following shell commands:
printf '\e[?5h' # Turn on reverse video
printf '\e[?5l' # Turn on normal video
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With