exec.php - Last line of shell execute output repeated
When using exec.php to run a shell command, the last line of the output is repeated.
#1 Updated by Steve Beaver almost 4 years ago
- Status changed from Confirmed to Feedback
- Assignee changed from Steve Beaver to Jim Pingle
system() replaced with exec().
system() emits the output to STDOUT, but that is trapped
by PHP when running system. PHP then prints the output of the command
when using the "system" function call and returns the last line (which the
OP then echoes).
#3 Updated by Jim Pingle almost 4 years ago
- Status changed from Feedback to Confirmed
- Assignee changed from Jim Pingle to Steve Beaver
Interesting. On 2.2.x it is using popen rather than either system or exec. Wonder why that was changed away from popen.
There is still an extra blank line at the end of the output, looks like it's a bunch of indentation before the closing pre tag.