るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Shell#pushd(path = nil, &block) -> object (9162.0)

カレントディレクトリをディレクトリスタックにつみ, カレントディレク トリをpathにする. pathが省略されたときには, カレントディレクトリと ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと きには, ブロック実行中のみpushdする.

...みpushdする.

@param path カレントディレクトリをpathにする。文字列で指定します。

@param block イテレータとして呼ぶ場合, ブロックを指定します。

動作例
require 'shell'
Shell
.verbose = false
sh
= Shell.new
sh
.pushd("/tmp")
p sh.cwd #=>...
..."/tmp"
sh
.pushd("/usr")
p sh.cwd #=> "/usr"
sh
.popd
p sh.cwd #=> "/tmp"
sh
.pushd("/usr/local"){
p sh.cwd #=> "/usr/local"
}
p sh.cwd #=> "/tmp"...

Shell#pushdir(path = nil, &block) -> object (9162.0)

カレントディレクトリをディレクトリスタックにつみ, カレントディレク トリをpathにする. pathが省略されたときには, カレントディレクトリと ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと きには, ブロック実行中のみpushdする.

...みpushdする.

@param path カレントディレクトリをpathにする。文字列で指定します。

@param block イテレータとして呼ぶ場合, ブロックを指定します。

動作例
require 'shell'
Shell
.verbose = false
sh
= Shell.new
sh
.pushd("/tmp")
p sh.cwd #=>...
..."/tmp"
sh
.pushd("/usr")
p sh.cwd #=> "/usr"
sh
.popd
p sh.cwd #=> "/tmp"
sh
.pushd("/usr/local"){
p sh.cwd #=> "/usr/local"
}
p sh.cwd #=> "/tmp"...

Shell#rehash -> {} (9102.0)

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

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

Shell#finish_all_jobs (6102.0)

@todo

@todo

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

@todo

...@todo

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

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

絞り込み条件を変える

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

command を実行する.

...で指定します。

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

使用例:

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

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

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

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

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

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

Shell#echo(*strings) -> Shell::Filter (3114.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(l) | tee(fi...

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

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

...
パターンの書式については、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...

Shell#tee(file) -> Shell::Filter (3114.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(fi...

絞り込み条件を変える

Shell#command_processor -> Shell::CommandProcessor (3102.0)

@todo

@todo

Shell#concat(*jobs) -> Shell::Concat (3102.0)

@todo

@todo

Shell#process_controller -> Shell::ProcessController (3102.0)

@todo

@todo

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

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

...定します。

require 'shell'
Shell
.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#popd -> () (3044.0)

ディレクトリスタックからポップし, それをカレントディレクトリにする.

...ディレクトリスタックからポップし, それをカレントディレクトリにする.

動作例
require 'shell'
Shell
.verbose = false
sh
= Shell.new
sh
.pushd("/tmp")
p sh.cwd #=> "/tmp"
sh
.pushd("/usr")
p sh.cwd #=> "/usr"
sh
.popd
p sh.cwd #=> "/tmp"...

絞り込み条件を変える

Shell#popdir -> () (3044.0)

ディレクトリスタックからポップし, それをカレントディレクトリにする.

...ディレクトリスタックからポップし, それをカレントディレクトリにする.

動作例
require 'shell'
Shell
.verbose = false
sh
= Shell.new
sh
.pushd("/tmp")
p sh.cwd #=> "/tmp"
sh
.pushd("/usr")
p sh.cwd #=> "/usr"
sh
.popd
p sh.cwd #=> "/tmp"...

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

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

...定します。

require 'shell'
Shell
.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...
<< 1 2 3 ... > >>