Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > shell/filterライブラリ > Shell::Filterクラス > system

instance method Shell::Filter#system

system(command, *opts) -> Shell::SystemCommand

command を実行する.

[PARAM] command:
実行するコマンドのパスを文字列で指定します。
[PARAM] opts:
command のオプションを文字列で指定します。複数可。

使用例:

require 'shell'
Shell.verbose = false
sh = Shell.new

print sh.system("ls", "-l")
Shell.def_system_command("head")
sh.system("ls", "-l") | sh.head("-n 3") > STDOUT
class Shell::Filter