るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.019秒)

別のキーワード

  1. shell/builtin-command new
  2. rubygems/command command
  3. irb/extend-command def_extend_command
  4. irb/extend-command install_extend_commands
  5. shell/builtin-command each

検索結果

FileUtils#sh(*cmd) {|result, status| ... } (9.0)

与えられたコマンドを実行します。

...しては Kernel.#exec を参照してください。


例:
sh %{ls -ltr}

sh 'ls', 'file with spaces'

# check exit status after command runs
sh %{grep pattern file} do |ok, res|
if ! ok
puts "pattern not found (status = #{res.exitstatus})"
end
end

@see Kerne...