るりまサーチ

最速Rubyリファレンスマニュアル検索!
474件ヒット [1-100件を表示] (0.023秒)
トップページ > クエリ:sh[x] > クラス:Shell::Filter[x]

別のキーワード

  1. rake sh
  2. fileutils sh
  3. _builtin lock_sh
  4. constants lock_sh
  5. sync sh

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Shell::Filter#rehash -> {} (9101.0)

登録されているシステムコマンドの情報をクリアします。 通常、使うことはありません。

登録されているシステムコマンドの情報をクリアします。
通常、使うことはありません。

Shell::Filter#finish_all_jobs (6101.0)

@todo

@todo

Shell::Filter.new(sh) -> Shell::Filter (3202.0)

Shell::Filter クラスのインスタンスを返します。 通常このメソッドを直接使う機会は少ないでしょう。

...
Shell::Filter
クラスのインスタンスを返します。
通常このメソッドを直接使う機会は少ないでしょう。...

Shell::Filter#append(to, filter) -> Shell::AppendFile | Shell::AppendIO (3201.0)

@todo

...@todo

@param to 文字列か IO を指定します。

@param filter Shell::Filter のインスタンスを指定します。...

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

command を実行する.

...で指定します。

@param opts command のオプションを文字列で指定します。複数可。

使用例:

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

print sh.system("ls", "-l")
Sh
ell.def_system_command("head")
sh
.system("ls", "-l") | sh.head("-n 3") > STDOUT...

絞り込み条件を変える

Shell::Filter#cat(*files) -> Shell::Filter (3113.0)

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

...ram files シェルコマンド cat に与えるファイル名を文字列で指定します。

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

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

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

....

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

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

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

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

...
パターンの書式については、Dir.[] を参照してください。

動作例
require 'shell'
Sh
ell.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...

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

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

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

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

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

@todo

@todo

絞り込み条件を変える

Shell::Filter#input -> Shell::Filter | nil (3101.0)

現在のフィルターを返します。

現在のフィルターを返します。

Shell::Filter#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (3043.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...定します。

require 'shell'
Sh
ell.verbose = false
sh
= Shell.new
begin
sh
.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true...

Shell::Filter#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (3043.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...定します。

require 'shell'
Sh
ell.verbose = false
sh
= Shell.new
begin
sh
.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true...

Shell::Filter#>(to) -> self (3025.0)

toをフィルタの出力とする。 toが, 文字列ならばファイルに, IOオブジェクトであれ ばそれをそのまま出力とする。

...ルに,IOオブジェクトならばそれに出力します。

使用例
require 'shell'
Sh
ell.def_system_command("tail")
sh
= Shell.new
sh
.transact {
(sh.tail("-n 3") < "/etc/passwd") > File.open("tail.out", "w")
#(sh.tail("-n 3") < "/etc/passwd") > "tail.out" # と同じ.
}...

Shell::Filter#>>(to) -> self (3025.0)

toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。

...、IOオブジェクトならばそれに出力します。

使用例
require 'shell'
Sh
ell.def_system_command("tail")
sh
= Shell.new
sh
.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> File.open("tail.out", "w") # でも同じ。
}...

絞り込み条件を変える

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

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

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

例:

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

Shell::Filter#<(src) -> self (3019.0)

srcをフィルタの入力とする。 srcが, 文字列ならばファイルを, IOオブジェクトであれ ばそれをそのまま入力とする。

...ばそれをそのまま入力とする。

@param src フィルタの入力を, 文字列もしくは,IO オブジェクトで指定します。

使用例
require 'shell'
Sh
ell.def_system_command("head")
sh
= Shell.new
sh
.transact {
(sh.head("-n 30") < "/etc/passwd") > "ugo.txt"
}...
<< 1 2 3 ... > >>