php - Bash seems to be executing command 2nd time when variable of captured output is used -


output=$(php -f somecommand arg1 arg2 arg3 2>&1) echo "$output" >> error.log 

the script runs cron. in emailed output received looks php -f ... command run twice.

is run once when variable set, , again when variable echoed? don't remember behavior happening before.

if happening... how program output variable without re-executing program?


Comments