217件ヒット
[1-100件を表示]
(0.022秒)
種類
- インスタンスメソッド (144)
- 特異メソッド (36)
- 文書 (25)
- ライブラリ (12)
ライブラリ
- shell (60)
-
shell
/ builtin-command (36) -
shell
/ command-processor (30) -
shell
/ filter (36) -
shell
/ process-controller (6) -
shell
/ system-command (12)
クラス
- Shell (60)
-
Shell
:: Cat (6) -
Shell
:: CommandProcessor (30) -
Shell
:: Concat (6) -
Shell
:: Echo (6) -
Shell
:: Filter (36) -
Shell
:: Glob (6) -
Shell
:: ProcessController (6) -
Shell
:: SystemCommand (12) -
Shell
:: Tee (6) -
Shell
:: Void (6)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
alias
_ command (6) - cat (18)
-
def
_ system _ command (6) -
each
_ active _ object (6) - echo (18)
- foreach (18)
- glob (18)
-
install
_ system _ commands (6) -
ruby 1
. 6 feature (12) -
super
_ each (6) - tee (18)
-
unalias
_ command (6) -
undef
_ system _ command (6) -
win32
/ registry (12)
検索結果
先頭5件
-
Shell
# foreach(path = nil , &block) -> () (23118.0) -
pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。
...イルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。
@param path ファイルもしくはディレクトリのパスを文字列で指定します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|f|
puts f... -
Shell
:: Filter # each(rs = nil) -> () (21125.0) -
フィルタの一行ずつをblockに渡します。
...行ずつをblockに渡します。
@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。
使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}... -
Shell
:: Cat # each(rs = nil) {|line| . . . } (21101.0) -
@todo
@todo -
Shell
:: Concat # each(rs = nil) {|job| . . . } (21101.0) -
@todo
@todo -
Shell
:: Echo # each(rs = nil) {|str| . . . } (21101.0) -
@todo
@todo -
Shell
:: Glob # each(rs = nil) {|file| . . . } (21101.0) -
@todo
@todo -
Shell
:: SystemCommand # each(rs = nil) {|line| . . . } (21101.0) -
@todo
@todo
@param rs -
Shell
:: Tee # each(rs = nil) {|line| . . . } (21101.0) -
@todo
@todo -
Shell
:: Void # each(rs = nil) { . . . } -> nil (21101.0) -
何もしません。
何もしません。 -
Shell
# cat(*files) -> Shell :: Filter (17131.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...るファイル名を文字列で指定します。
動作例
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"
}
}
}... -
Shell
# echo(*strings) -> Shell :: Filter (17131.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...に与える引数を文字列で指定します。
動作例
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"
}
}
}... -
Shell
# glob(pattern) -> Shell :: Filter (17131.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 + ".tee") >> "all.tee"
}
}
}... -
Shell
# tee(file) -> Shell :: Filter (17131.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...るファイル名を文字列で指定します。
動作例
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"
}
}
}... -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (17131.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 NameError => err... -
Shell
. def _ system _ command(command , path = command) -> nil (17070.0) -
Shell のメソッドとして command を登録します.
...
Shell のメソッドとして command を登録します.
OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.
@param command Shell のメソッド......。
例)
require 'shell'
Shell.def_system_command "ls"
# ls を定義
Shell.def_system_command "sys_sort", "sort"
# sortコマンドをsys_sortとして定義
sh = Shell.new
sh.transact {
ls.each { |l|
puts l
}
(ls("-l") | sys_sort("-k 5")).each {|l|
puts l... -
Shell
. alias _ command(alias , command , *opts) { . . . } -> self (17052.0) -
コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
...コマンドの別名(エイリアス)を作成します。
コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
@param alias エイリアスの名前を文字列で指定します.
@param command コマンド名を文字列で指定します.
@param......を指定します.
使用例: ls -la | sort -k 5 のような例。
require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "ls", "-a", "-l")
Shell.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}... -
Shell
. unalias _ command(alias) -> () (17048.0) -
commandのaliasを削除します.
...例。
require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "ls", "-a", "-l")
Shell.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}
Shell.unalias_command("lsla")
begin
Shell.unalias_command("...