るりまサーチ

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

別のキーワード

  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 (9161.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 (9161.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 -> {} (9101.0)

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

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

Shell#finish_all_jobs (6101.0)

@todo

@todo

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

@todo

...@todo

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

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

絞り込み条件を変える

Shell#system(command, *opts) -> Shell::SystemCommand (3125.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 (3113.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 (3113.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 (3113.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 (3113.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.undef_system_command(command) -> Shell::CommandProcessor (3113.0)

commandを削除します.

...するコマンドの文字列を指定します。

動作例:
require 'shell'
Shell
.def_system_command("ls")
# ls を定義
Shell
.undef_system_command("ls")
# ls を 削除

sh
= Shell.new
begin
sh
.transact {
ls("-l").each {|l|
puts l
}
}
rescue NameEr...

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

@todo

@todo

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

@todo

@todo

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

@todo

@todo

Shell.new(pwd = Dir.pwd, umask = nil) -> Shell (3101.0)

プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShellオ ブジェクトを生成します.

...プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShell
ブジェクトを生成します.

@param pwd プロセスのカレントディレクトリをpwd で指定されたディレクトリとします。
指定しない場合は、Dir....

絞り込み条件を変える

Shell#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (3043.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 -> () (3043.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"...
<< 1 2 3 ... > >>