Answer the question
In order to leave comments, you need to log in
How to write the result of BASH script execution to a log file?
Hello.
I re-read a lot of material on the Internet, but I still didn’t understand how to write the result of the bash script to a log file (roughly speaking, writing everything that is output to the console after running the bash script.
My script is as follows:
for ((i=2; i<=$1 ; i++));
do
php /var/www/powerusb/data/gamerobot/robot.php $i &
done
Answer the question
In order to leave comments, you need to log in
Try like this:
for ((i=2; i<=$1 ; i++));
do
php /var/www/powerusb/data/gamerobot/robot.php $i >> /tmp/robot.$i 2>&1 &
done
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question