module POSIX::Spawn
def system_command_prefixes
[['/bin/sh', '/bin/sh'], '-c']
On all other systems, this will yield:
than 'cmd.exe', specify its path in ENV['COMSPEC']
is not specified. If you would like to use something other
Note: 'cmd.exe' is used if the COMSPEC environment variable
[['cmd.exe', 'cmd.exe'], '/c']
On a Windows machine, this will yield:
Derives the shell command to use when running the spawn.
def system_command_prefixes if RUBY_PLATFORM =~ /(mswin|mingw|cygwin|bccwin)/ sh = ENV['COMSPEC'] || 'cmd.exe' [[sh, sh], '/c'] else [['/bin/sh', '/bin/sh'], '-c'] end end