that IS a good way, thats te way you are meant to do it

you may want to tweak what shell output can, and cannot be logged.
CODE
sh a.sh | grep LOG >> log
this will only log lines with the word "LOG" in them.. for example
"LOG: 1:00pm, and all is well."
EDIT:
just noticed
QUOTE
while true
do
sh a.sh
sh a.sh >>log
sh b.sh
sh b.sh >>log
done
So, you want the script to print to the console, AND write to the log..
yes, there is a much better way, you dont need to run the script twice.
use a variable to store the output..
this code example run the porgram "uptime" and outputs its result to the scree, and a logfile.
the variable name is called CURRENT_UPTIME
CODE
#!/bin/bash
CURRENT_UPTIME=`uptime`
# print to screen.
echo $CURRENT_UPTIME
#print to log
echo $CURRENT_UPTIME >> log
EDIT2:
it not clear on this forum, but those ` marks are the single back tilted quotes... using the normal ' will not work.
on my keyboard, the ` (correct mark) is the one below the ESC key.
in BASH shell programming, all 3 different quote marks have different meanings.
Comment/Reply (w/o sign-up)