'system': bug or misunderstanding?
clerke
clerke at eim.ae
Sat Jan 5 13:02:33 CST 2008
On Saturday 05 January 2008 20:16:38 John W. Eaton wrote:
> On 5-Jan-2008, clerke wrote:
> | On Friday 04 January 2008 22:29:01 John W. Eaton wrote:
> | > This is documented, though I suppose not very clearly. I would
> | > welcome a patch that improved the doc string.
> |
> | Is system.texi the right file for the patch?
>
> No, the doc string for the system function is in the source file that
> defines the system function, src/toplev.cc.
Yep. Found it.
I've attached a changelog entry and patch for the system documentation.
Just my take on the situation. I hope it's mostly right.
I don't seem to have the doc toolchain (munge-texi?) installed, so the
attached patch may not work oob, but the text might be useful anyway.
> | For example, the description says:
> | "To send the output of a command executed with @var{system} through the
> | pager, use a command like
> | disp (system (cmd, 1));"
> |
> | This doesn't work for me (because system, used like this, returns only
> | the exit status). Examples:
>
> It used to work this way, but we had to change the order of the
> outputs for compatibility with Matlab (see the NEWS file). So the doc
> string is wrong now.
>
> | octave:58> disp(system("ls", 1))
> | 0
> | octave:59> system("ls", 1)
> | ans = 0
> |
> | In all cases, to get the output returned to octave (rather than stdout) I
> | need to specify the second output arg.
> | Is this the way everyone else sees it?
>
> Yes.
>
> jwe
-------------- next part --------------
2008-1-5 Wayne Clerke <clerke at eim.ae>
* toplev.cc: rework documentation for system function
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toplev.cc.patch01
Type: text/x-diff
Size: 3179 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080105/902b4584/attachment.bin
More information about the Help-octave
mailing list