diff libinterp/corefcn/toplev.cc @ 24009:eef8c31ffe97

Document that the shell for system() differs between OS (bug #49825). * toplev.cc (Fsystem): Change example code to run on Windows or UNIX reliably. Document that the shell for system() differs between OS.
author Rik <rik@octave.org>
date Tue, 05 Sep 2017 15:43:40 -0700
parents e8a74d95b4f3
children 194eb4bd202b
line wrap: on
line diff
--- a/libinterp/corefcn/toplev.cc	Tue Sep 05 11:45:43 2017 -0700
+++ b/libinterp/corefcn/toplev.cc	Tue Sep 05 15:43:40 2017 -0700
@@ -188,7 +188,7 @@
 command that was written to the standard output stream.  For example,
 
 @example
-[status, output] = system ("echo foo; exit 2");
+[status, output] = system ("echo foo & exit 2");
 @end example
 
 @noindent
@@ -197,6 +197,10 @@
 
 For commands run asynchronously, @var{status} is the process id of the
 command shell that is started to run the command.
+
+The shell used for executing commands varies with operating system and is
+typically @file{/bin/sh} for UNIX systems and @file{cmd.exe} for Windows
+systems.
 @seealso{unix, dos}
 @end deftypefn */)
 {