Hi!,
In my shell scripts, I always create a logfile by adding the following line in the beginning:
exec >file.log 2>&1
This in turn directs all the output to this logfile till the script executes.
But now, I have to write some output to the monitor for the users.
So, i am doing it by the following method:
CUR_DEVICE=`tty`
echo "Whatever to be outputed" >$CUR_DEVICE
This works for me.. But is there any better way than this??