I have to troubleshoot a issue and need to modify a perl script to append the output of a command within the perl script to a log file rather than overwrite it. Here is the line I need to change:
$result = `command > /var/log/logfile`;
command is defined at the top of the script like so:
my command = $path . "Bashscript.sh"
I'm a bash scripter not a perl scripter. To append the output of the command to a log file I would simply use ">>" versus the singe ">". Can I do this in perl? So the line would read:
$result = `command >> /var/log/logfile`;
This is a important production machine, so I wanted to make sure before I did this. This would only be temporary, I would change it back later.
Start Free Trial