180件ヒット
[1-100件を表示]
(0.074秒)
種類
- インスタンスメソッド (144)
- 特異メソッド (36)
ライブラリ
- 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)
キーワード
-
alias
_ command (6) - cat (18)
-
def
_ system _ command (6) -
each
_ active _ object (6) - echo (18)
- foreach (18)
- glob (18)
-
install
_ system _ commands (6) -
super
_ each (6) - tee (18)
-
unalias
_ command (6) -
undef
_ system _ command (6)
検索結果
先頭5件
-
Shell
# foreach(path = nil , &block) -> () (26218.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|
put... -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (26170.0) -
system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.
...をShellに定義する. メソッ
ド名は元のファイル名の頭にpreをつけたものとなる.
@param pre Shellに定義するメソッド名の先頭に付加される文字列を指定します。
使用例: ls -l | head -n 5 のような例。
require 'shell'
Shell.install_syste......m_commands
sh = Shell.new
sh.verbose = false
sh.transact {
(sys_ls("-l") | sys_head("-n 5")).each {|l|
puts l
}
}... -
Shell
:: Filter # each(rs = nil) -> () (24225.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| . . . } (24201.0) -
@todo
@todo -
Shell
:: Concat # each(rs = nil) {|job| . . . } (24201.0) -
@todo
@todo -
Shell
:: Echo # each(rs = nil) {|str| . . . } (24201.0) -
@todo
@todo -
Shell
:: Glob # each(rs = nil) {|file| . . . } (24201.0) -
@todo
@todo -
Shell
:: SystemCommand # each(rs = nil) {|line| . . . } (24201.0) -
@todo
@todo
@param rs -
Shell
:: Tee # each(rs = nil) {|line| . . . } (24201.0) -
@todo
@todo -
Shell
:: Void # each(rs = nil) { . . . } -> nil (24201.0) -
何もしません。
何もしません。 -
Shell
. alias _ command(alias , command , *opts) { . . . } -> self (23270.0) -
コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
...Shell.def_system_command などであらかじめ作成します.
@param alias エイリアスの名前を文字列で指定します.
@param command コマンド名を文字列で指定します.
@param opts command で指定したコマンドのオプションを指定します.
使用例: 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) -> () (23266.0) -
commandのaliasを削除します.
...aliasを削除します.
@param alias 削除したいエイリアスの名前を文字列で指定します。
@raise NameError alias で指定したコマンドが無い場合に発生します。
使用例: 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("lsla")
begin
Shell.unalias_command("lsla")
rescue NameError => err
puts err
end... -
Shell
# glob(pattern) -> Shell :: Filter (23243.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.n......ew
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}
@see Dir.[]... -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (20249.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
puts err... -
Shell
# cat(*files) -> Shell :: Filter (20243.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...る Filter オブジェクトを返します.
@param 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(file + ".tee") >> "all.tee"
}
}
}... -
Shell
# echo(*strings) -> Shell :: Filter (20243.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...lter オブジェクトを返します.
@param strings シェルコマンド echo に与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(fil......e).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}... -
Shell
# tee(file) -> Shell :: Filter (20243.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...する 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(file + ".tee") >> "all.tee"
}
}
}...