diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-05 16:42:37 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-05 16:42:37 +0000 |
commit | 0bd6f36aa73059022fd5dd9cc2462cb4b785ba25 (patch) | |
tree | 0aaa3776d60c78989298ee77da0e5440f893a22d | |
parent | e171d499d8b5bbc18abbe67106c3dfaf1c5216d1 (diff) | |
download | ruby-0bd6f36aa73059022fd5dd9cc2462cb4b785ba25.tar.gz |
* process.c: [DOC] Document caveats of command form of Process.spawn
with regard to the shell and OS. Patched by Steve Klabnik [Bug #8550]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | process.c | 10 |
2 files changed, 14 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Tue Aug 6 01:40:37 2013 Zachary Scott <e@zzak.io> + + * process.c: [DOC] Document caveats of command form of Process.spawn + with regard to the shell and OS. Patched by Steve Klabnik [Bug #8550] + Tue Aug 6 01:28:35 2013 Zachary Scott <e@zzak.io> * lib/rss/0.9.rb: [DOC] Typo in example [Bug #8732] @@ -3864,7 +3864,7 @@ rb_f_system(int argc, VALUE *argv) * name => nil : unset the environment variable * command...: * commandline : command line string which is passed to the standard shell - * cmdname, arg1, ... : command name and one or more arguments (no shell) + * cmdname, arg1, ... : command name and one or more arguments (This form does not use the shell. See below for caveats.) * [cmdname, argv0], arg1, ... : command name, argv[0] and zero or more arguments (no shell) * options: hash * clearing environment variables: @@ -3905,6 +3905,14 @@ rb_f_system(int argc, VALUE *argv) * current directory: * :chdir => str * + * The 'cmdname, arg1, ...' form does not use the shell. However, + * on different OSes, different things are provided as built-in + * commands. An example of this is 'echo', which is a built-in + * on Windows, but is a normal program on Linux and Mac OS X. + * This means that `Process.spawn 'echo', '%Path%'` will display + * the contents of the `%Path%` environment variable on Windows, + * but `Process.spawn 'echo', '$PATH'` prints the literal '$PATH'. + * * If a hash is given as +env+, the environment is * updated by +env+ before <code>exec(2)</code> in the child process. * If a pair in +env+ has nil as the value, the variable is deleted. |