るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.167秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:n[x] > クエリ:cat[x] > クラス:Shell::Filter[x]

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. openssl n
  5. openssl n=

ライブラリ

キーワード

検索結果

Shell::Filter#concat(*jobs) -> Shell::Concat (12402.0)

@todo

@todo

Shell::Filter#truncate(path, length) -> 0 (12202.0)

File クラスにある同名のクラスメソッドと同じです.

...File クラスにある同名のクラスメソッドと同じです.

@param path パスを表す文字列を指定します。

@param length 変更したいサイズを整数で与えます。

@see File.truncate...

Shell::Filter#each(rs = nil) -> () (108.0)

フィルタの一行ずつをblockに渡します。

...行ずつをblockに渡します。

@param rs レコードセパレーターを表す文字列を指定します。
n
il ならば、Shell.record_separatorの値が使用されます。

使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}...

Shell::Filter#echo(*strings) -> Shell::Filter (108.0)

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

...返します.

@param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
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...

Shell::Filter#glob(pattern) -> Shell::Filter (108.0)

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

...ます.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

動作例
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(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

絞り込み条件を変える

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

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

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

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

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

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

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

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

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

Shell::Filter#|(filter) -> object (26.0)

パイプ結合を filter に対して行います。

...m filter Shell::Filter オブジェクトを指定します。

@return filter を返します。

使用例
require 'shell'
Shell.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
i = 1
while i <= (cat("/etc/p...
...asswd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i += 1
end
}...