system(command, *opts)
public
Executes the given command with the options parameter.
Example:
print sh.system("ls", "-l")
sh.system("ls", "-l") | sh.head > STDOUT
Show source
def system(command, *opts)
if opts.empty?
if command =~ /\*|\?|\{|\}|\[|\]|<|>|\(|\)|~|&|\||\\|\$|;|'|`|"|\n/
return SystemCommand.new(@shell, find_system_command("sh"), "-c", command)
else
command, *opts = command.split(/\s+/)
end
end
SystemCommand.new(@shell, find_system_command(command), *opts)
end