If you like to log the details to the log file as well as display it in o/p, then you should use tee command. If you just need to redirect it to a file, then use the >> redirect operator.
If you think it is too cumbersome to type it in every line of the script, then open vi and then take it to the command mode and then
:1,$s/$/ \| tee -a \$logfile/g
the above command should be able to put the tee for you.
I can do this, but if someone views my code it looks like so many tee.
I dont want to append tee when i am using sed or awk for processing; only when i am echoing.
i thought there might be a way where i can take output of each function and output it on screen as well as in log file, without using tee at each line.
You could do this: at the beginning of your script, put
tail -f $logfile &
(make sure it's empty first). Save the PID ($!), run your usual script with stdout redirected to the logfile (either by line or by exec 1>$logfile). At the end of your script, kill the tail (you saved the PID, didn't you?)