Project

General

Profile

Bug #5101

exec.php - Last line of shell execute output repeated

Added by Jim Pingle almost 4 years ago. Updated almost 4 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:

Associated revisions

Revision 6aef15f8 (diff)
Added by Steve Beaver almost 4 years ago

Fixed #5101
system() command replaced with exec()

Revision 8c4455dd (diff)
Added by Steve Beaver almost 4 years ago

Fixed #5101
Removed new line/space before closing

History

#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).

#2 Updated by Steve Beaver almost 4 years ago

  • % Done changed from 0 to 100

#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.

#4 Updated by Steve Beaver almost 4 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Steve Beaver to Jim Pingle

Removed new line/space before closing

#5 Updated by Jim Pingle almost 4 years ago

  • Status changed from Feedback to Resolved

Looks good now, thanks!

Also available in: Atom PDF