bugGNU Octave - Bugs: bug #43716, system function won't capture...

 
 

bug #43716: system function won't capture screen output for some external commnad

Submitted by:  Xiangrui Li <xiangrui>
Submitted on:  Thu 27 Nov 2014 06:22:56 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Works For MeAssigned to: None
Originator Name: Xiangrui LiOpen/Closed: Closed
Release: 3.8.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 19 Dec 2014 11:33:10 PM UTC, comment #4:

But shouldn't system capture stderr as well? As far as I can tell Matlab captures everything..

Matlab:

Octave:

sergey plotnikov <nul0m>
Fri 28 Nov 2014 09:37:49 PM UTC, comment #3:

Thanks for confirming the workaround works for you. This probably means that gzip 1.2.4 prints its version to stderr instead of stdout.

Mike Miller <mtmiller>
Project Administrator
Fri 28 Nov 2014 09:22:52 PM UTC, comment #2:

The gzip version is 1.2.4 under Windows. The one under Linux comes with Ubuntu 14.04, and I don't know its version since I have no access to it now.

The "2>&1" trick works perfectly for me under Windows (Octave 3.6.4), and I guess it will work under Linux for Octave 3.8.1. It also works fine for other command. If a command does not exist, the error message goes to cmdout.

Actually my current purpose is to check whether external compression command, like pigz, gzip, exists. If yes, I would use them, since they are faster than Matlab/Octave built-in gzip.m.

This trick won't affect Matlab behavior, so I have simple fix for now. Thank you very much.

Xiangrui Li <xiangrui>
Fri 28 Nov 2014 02:33:54 PM UTC, comment #1:

Thanks for your bug report. This works fine for me with Octave 3.8.1 on linux.

What is the version of gzip that is output to the screen? Is it possible that your version of gzip is sending the version to stderr while mine is going to stdout? Does

work for you?

Mike Miller <mtmiller>
Project Administrator
Thu 27 Nov 2014 06:22:56 PM UTC, original submission:

Following captures the output as expected:
[status, cmdout]= system('dir'); % same for 'echo dsfa' etc

However, following still gives screen output, and cmdout is empty:
[status, cmdout]= system('gzip -V');

In Matlab, there is no screen output for both above cases, and the screen output always goes to cmdout.

The behavior is the same for Windows 7 and Linux.

Xiangrui Li <xiangrui>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by nul0m (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by xiangrui (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 28 Nov 2014 09:37:49 PM UTCmtmillerOpen/ClosedOpen=>Closed
    Fri 28 Nov 2014 02:33:54 PM UTCmtmillerStatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1