Actions
Bug #5101
closedexec.php - Last line of shell execute output repeated
Description
When using exec.php to run a shell command, the last line of the output is repeated.
Example #1:
Example #2:
Actions
Added by Jim Pingle about 9 years ago. Updated about 9 years ago.
Description
When using exec.php to run a shell command, the last line of the output is repeated.
Example #1:
Example #2:
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).
Applied in changeset pfsense:6aef15f8cfa409d19e421bf2858667ca5de5026b.
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.
Removed new line/space before closing
Looks good now, thanks!