I have the following in a shell script
fulloutput="<pre>$(df -h /;sudo shutdown -r +1 )</pre>"
Later in the script I echo this variable (it's piped to sendmail but that's irrelevant here) but I only get the output from the df command, not the shutdown.
I have tried without sudo
and I have tried separating the commands like follows...
fulloutput="<pre>$(df -h /) $(sudo shutdown -r +1 )</pre>"
But still only get the output from the df
command.
It's not a big issue, but it would be nice to get the output from shutdown
as an indicator that that part of my script has executed succesfully.