[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'system': bug or misunderstanding?
From: |
John W. Eaton |
Subject: |
'system': bug or misunderstanding? |
Date: |
Fri, 04 Jan 2008 13:29:01 -0500 |
On 1-Jan-2008, clerke wrote:
| Shouldn't these two commands both send 'foo' back to my screen?
| (Octave 3.0.0 on gentoo/amd64, but I noticed it in earlier Octave versions
| too).
|
| octave:1> system ("echo foo; exit 2",1,"async")
| ans = 829
| octave:2> foo
|
| octave:2> system ("echo foo; exit 2",1,"sync")
| ans = 2
| octave:3>
| octave:3>
|
| In particular, i would have thought the sync version should do it.
No, the sync version should return the output from the system command
(you specified that with the second argument of 1):
octave:1> [status, output] = system ("echo foo; exit 2",1,"sync")
status = 2
output = foo
This is documented, though I suppose not very clearly. I would
welcome a patch that improved the doc string.
| Sooo...am i totally misunderstanding how system should work?
| And either way, how do I get 'edit' to work?
If your problem is with edit, then how about sending a precise recipe
for duplicating the problem your are having with it?
jwe