るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.011秒)
トップページ > クエリ:exitstatus[x] > モジュール:FileUtils[x]

別のキーワード

  1. status exitstatus
  2. _builtin exitstatus
  3. exitstatus _builtin
  4. localjump_exitstatus

ライブラリ

検索結果

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

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

...参照してください。


例:
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 Kernel.#exec, Kernel.#system...