153件ヒット
[1-100件を表示]
(0.051秒)
別のキーワード
種類
- インスタンスメソッド (96)
- 特異メソッド (57)
ライブラリ
- shell (153)
キーワード
- [] (6)
-
alias
_ command (6) - append (6)
- cat (6)
- debug (12)
- debug? (12)
-
debug
_ output _ exclusive _ unlock (3) -
debug
_ output _ unlock (6) -
def
_ system _ command (6) - echo (6)
- foreach (6)
- glob (6)
-
install
_ system _ commands (6) - notify (6)
- open (6)
- out (6)
- size (6)
- size? (6)
- system (6)
- tee (6)
- test (6)
- transact (6)
-
unalias
_ command (6) -
undef
_ system _ command (6)
検索結果
先頭5件
-
Shell
# [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (307.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...ァイルへのパスを指定します。
@param file2 文字列でファイルへのパスを指定します。
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"... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (307.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...ァイルへのパスを指定します。
@param file2 文字列でファイルへのパスを指定します。
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"... -
Shell
# debug -> bool | Integer (103.0) -
@todo
@todo -
Shell
# debug? -> bool | Integer (103.0) -
@todo
@todo -
Shell
. debug -> bool | Integer (103.0) -
@todo
@todo
デバッグ用フラグを参照します。 -
Shell
. debug? -> bool | Integer (103.0) -
@todo
@todo
デバッグ用フラグを参照します。 -
Shell
# append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (102.0) -
@todo
...@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。... -
Shell
# open(path , mode) -> File | Dir (102.0) -
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
path がファイルなら、 File.open path がディレクトリなら、 Dir.open の動作をします。
@param path 開きたいパスを指定します。
@param mode アクセスモードを指定します。path がディレクトリの場合は無視されます。
@see File.open, Dir.open -
Shell
# size?(file) -> Integer | nil (102.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#size FileTest.#size? -
Shell
. debug _ output _ exclusive _ unlock { . . . } -> Mutex | nil (102.0) -
@todo
@todo
@see Mutex#exclusive_unlock -
Shell
. debug _ output _ unlock -> Mutex | nil (102.0) -
@todo
@todo
@see Mutex#unlock@todo
@see Thread::Mutex#unlock -
Shell
. notify(*opts) {|message| . . . } -> String (102.0) -
@todo
@todo -
Shell
# cat(*files) -> Shell :: Filter (31.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 (31.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 (31.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"
}
}
}
@see Dir.[]... -
Shell
# tee(file) -> Shell :: Filter (31.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
. def _ system _ command(command , path = command) -> nil (25.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
# out(dev = STDOUT , &block) -> () (19.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...
Shell#transact を呼び出しその結果を dev に出力します。
@param dev 出力先をIO オブジェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.......new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...