るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Shell::CommandProcessor#rehash -> {} (9102.0)

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

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

Shell::CommandProcessor#finish_all_jobs (6102.0)

@todo

@todo

Shell::CommandProcessor#append(to, filter) -> Shell::AppendFile | Shell::AppendIO (3202.0)

@todo

...@todo

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

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

Shell::CommandProcessor#system(command, *opts) -> Shell::SystemCommand (3126.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::CommandProcessor#cat(*files) -> Shell::Filter (3114.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::CommandProcessor#echo(*strings) -> Shell::Filter (3114.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::CommandProcessor#glob(pattern) -> Shell::Filter (3114.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::CommandProcessor#tee(file) -> Shell::Filter (3114.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::CommandProcessor#concat(*jobs) -> Shell::Concat (3102.0)

@todo

@todo

Shell::CommandProcessor#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (3044.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::CommandProcessor#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (3044.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::CommandProcessor#transact { ... } -> object (3026.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::CommandProcessor#foreach(path = nil, &block) -> () (3014.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

...なら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require 'shell'
Sh
ell.verbose = false
sh
= Shell.new
sh
.foreach("/tmp"){|f|
puts f
}...

Shell::CommandProcessor#mkdir(*path) -> Array (3014.0)

Dir.mkdirと同じです。 (複数可)

...ram path 作成するディレクトリ名を文字列で指定します。

@return 作成するディレクトリの一覧の配列を返します。

使用例
require 'shell'
Sh
ell.verbose = false
sh
= Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end...

Shell::CommandProcessor#out(dev = STDOUT, &block) -> () (3014.0)

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

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

@param dev 出力先をIO オブジェクトなどで指定します。

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


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

絞り込み条件を変える

Shell::CommandProcessor#atime(filename) -> Time (3002.0)

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

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

@param filename ファイル名を表す文字列か IO オブジェクトを指定します。

@see File.atime

Shell::CommandProcessor#basename(filename, suffix = "") -> String (3002.0)

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

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

@param filename ファイル名を表す文字列を指定します。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

@see File.basename
<< 1 2 3 ... > >>