るりまサーチ

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

別のキーワード

  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

モジュール

キーワード

検索結果

<< < ... 18 19 20 >>

Shell::Filter#out(dev = STDOUT, &block) -> () (7.0)

Shell#transact を呼び出しその結果を dev に出力します。

...ェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Shell::Filter#tee(file) -> Shell::Filter (7.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(...

Shell::Filter#to_a -> [String] (7.0)

実行結果を文字列の配列で返します。

...実行結果を文字列の配列で返します。

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a...

Shell::Filter#to_s -> String (7.0)

実行結果を文字列で返します。

...実行結果を文字列で返します。

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new

sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}...

Shell::Filter#transact { ... } -> object (7.0)

ブロック中で shell を self として実行します。

...ブロック中で shell を self として実行します。

例:

require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact{
system("ls", "-l") | head > STDOUT
# transact の中では、
# sh.system("ls", "-l") | sh.head > STDOUT と同じとなる。
}...

絞り込み条件を変える

<< < ... 18 19 20 >>