If you run alot of scripts in the background (remotely or on the console), you're likely frustrated by the command line's limited messaging facillities. You could write status messages to syslog via warn, or mail them to yourself, but both options are clumsy.
#! /bin/bash
function read_pipe {
while cat /home/$USER/pipe;
do tput cup 100 0;
OUT=$(cat /home/$USER/pipe);
printf "$OUT"; done;
}
while [[ -p pipe ]];
do tput cup 100 0;
read_pipe;
done;
This script will constantly read a named pipe in the user's home directory, and output the contents towards the bottom of the terminal (this will require some adjustment on larger screens).
Example: Track Code Red probes
tail -f ./access_log | awk '/default.ida/ { print $1}' > /home/$USER/pipe
See also:
man setterm
man tput