From 41a3fbff5f7482f84c169207c04222e55b805a41 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 5 Dec 2008 15:09:59 +0000 Subject: rdoc udpate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 57 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/process.c b/process.c index 81210783b4..7348863f56 100644 --- a/process.c +++ b/process.c @@ -1712,25 +1712,34 @@ rb_exec_arg_fixup(struct rb_exec_arg *e) /* * call-seq: - * exec([env,] command [, arg, ...] [,options]) + * exec([env,] command... [,options]) * * Replaces the current process by running the given external _command_. - * If optional arguments, sequence of +arg+, are not given, that argument is - * taken as a line that is subject to shell expansion before being - * executed. If one or more +arg+ given, they - * are passed as parameters to _command_ with no shell - * expansion. If +command+ is a two-element array, the first - * element is the command to be executed, and the second argument is - * used as the argv[0] value, which may show up in process - * listings. In order to execute the command, one of the exec(2) + * _command..._ is one of following forms. + * + * commandline : command line string which is passed to a shell + * cmdname, arg1, ... : command name and one or more arguments (no shell) + * [cmdname, argv0], arg1, ... : command name and arguments including argv[0] (no shell) + * + * If single string is given as the command, + * it is taken as a line that is subject to shell expansion before being executed. + * + * If two or more +string+ given, + * the first is taken as a command name and + * the rest are passed as parameters to command with no shell expansion. + * + * If a two-element array at the beginning of the command, + * the first element is the command to be executed, + * and the second argument is used as the argv[0] value, + * which may show up in process listings. + * + * In order to execute the command, one of the exec(2) * system calls is used, so the running command may inherit some of the environment * of the original program (including open file descriptors). - * - * The hash arguments, env and options, are same as - * system and spawn. + * This behavior is modified by env and options. * See spawn for details. * - * Raises SystemCallError if the _command_ couldn't execute (typically + * Raises SystemCallError if the command couldn't execute (typically * Errno::ENOENT when it was not found). * * exec "echo *" # echoes list of files in current directory @@ -2770,17 +2779,25 @@ rb_spawn(int argc, VALUE *argv) /* * call-seq: - * system([env,] cmd [, arg, ...] [,options]) => true, false or nil + * system([env,] command... [,options]) => true, false or nil + * + * Executes _command..._ in a subshell. + * _command..._ is one of following forms. * - * Executes _cmd_ in a subshell, returning +true+ if the command - * gives zero exit status, +false+ for non zero exit status. Returns - * +nil+ if command execution fails. An error status is available in - * $?. The arguments are processed in the same way as - * for Kernel::exec. + * commandline : command line string which is passed to a shell + * cmdname, arg1, ... : command name and one or more arguments (no shell) + * [cmdname, argv0], arg1, ... : command name and arguments including argv[0] (no shell) + * + * system returns +true+ if the command gives zero exit status, + * +false+ for non zero exit status. + * Returns +nil+ if command execution fails. + * An error status is available in $?. + * The arguments are processed in the same way as + * for Kernel.spawn. * * The hash arguments, env and options, are same as * exec and spawn. - * See spawn for details. + * See Kernel.spawn for details. * * system("echo *") * system("echo", "*") -- cgit v1.2.3