@@ -8919,13 +8919,8 @@ proc_warmup(VALUE _)
8919
8919
*
8920
8920
* < C* | $SHELL >
8921
8921
*
8922
- * However, on different OSes, different things are provided as
8923
- * built-in commands. An example of this is +'echo'+, which is a
8924
- * built-in on Windows, but is a normal program on Linux and Mac OS X.
8925
- * This means that <code>Process.spawn 'echo', '%Path%'</code> will
8926
- * display the contents of the <tt>%Path%</tt> environment variable on
8927
- * Windows, but <code>Process.spawn 'echo', '$PATH'</code> prints the
8928
- * literal <tt>$PATH</tt>.
8922
+ * However, there are exceptions on Windows. See {Execution Shell on
8923
+ * Windows}[rdoc-ref:Process@Execution+Shell+on+Windows].
8929
8924
*
8930
8925
* If you want to invoke a path containing spaces with no arguments
8931
8926
* without shell, you will need to use a 2-element array +exe_path+.
@@ -9082,10 +9077,27 @@ proc_warmup(VALUE _)
9082
9077
*
9083
9078
* /bin/bash: CONTRIBUTING.md COPYING COPYING.ja
9084
9079
*
9080
+ * === Execution Shell on Windows
9081
+ *
9085
9082
* On Windows, the shell invoked is determined by environment variable
9086
- * +RUBYSHELL+, if defined, or +COMSPEC+ otherwise. The standard
9087
- * shell +cmd.exe+ performs environment variable expansion but does
9088
- * not have globbing functionality:
9083
+ * +RUBYSHELL+, if defined, or +COMSPEC+ otherwise; the entire string
9084
+ * +command_line+ is passed as an argument to <tt>-c</tt> option for
9085
+ * +RUBYSHELL+, as well as <tt>/bin/sh</tt>, and {/c
9086
+ * option}[https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd]
9087
+ * for +COMSPEC+. The shell is invoked automatically in the following
9088
+ * cases:
9089
+ *
9090
+ * - The command is a built-in of +cmd.exe+, such as +echo+.
9091
+ * - The executable file is a batch file; its name ends with +.bat+ or
9092
+ * +.cmd+.
9093
+ *
9094
+ * Note that the command will still be invoked as +command_line+ form
9095
+ * even when called in +exe_path+ form, because +cmd.exe+ does not
9096
+ * accept a script name like <tt>/bin/sh</tt> does but only works with
9097
+ * <tt>/c</tt> option.
9098
+ *
9099
+ * The standard shell +cmd.exe+ performs environment variable
9100
+ * expansion but does not have globbing functionality:
9089
9101
*
9090
9102
* Example:
9091
9103
*
0 commit comments