Project

General

Profile

Actions

Bug #5101

closed

exec.php - Last line of shell execute output repeated

Added by Jim Pingle about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
09/03/2015
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

When using exec.php to run a shell command, the last line of the output is repeated.

Example #1:

Example #2:

Actions #1

Updated by Anonymous about 9 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Anonymous 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).

Actions #2

Updated by Anonymous about 9 years ago

  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle about 9 years ago

  • Status changed from Feedback to Confirmed
  • Assignee changed from Jim Pingle to Anonymous

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.

Actions #4

Updated by Anonymous about 9 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Anonymous to Jim Pingle

Removed new line/space before closing

Actions #5

Updated by Jim Pingle about 9 years ago

  • Status changed from Feedback to Resolved

Looks good now, thanks!

Actions

Also available in: Atom PDF