別のキーワード
クラス
- Array (11)
- Shell (510)
-
Shell
:: BuiltInCommand (12) -
Shell
:: CommandProcessor (372) -
Shell
:: Filter (420) -
Shell
:: ProcessController (78) -
Shell
:: SystemCommand (72) -
Shell
:: Void (6) - String (22)
キーワード
- < (6)
- >> (6)
- [] (18)
- active? (12)
-
active
_ job? (6) -
active
_ jobs (6) -
active
_ jobs _ exist? (6) -
add
_ schedule (6) - append (18)
- atime (18)
- basename (18)
- blockdev? (18)
- cat (18)
- cd (6)
- chardev? (18)
- chdir (6)
- chmod (18)
- chown (18)
- command (6)
-
command
_ processor (6) - concat (18)
- ctime (18)
- cwd (6)
- debug (6)
- debug? (6)
- delete (18)
- dir (6)
-
dir
_ stack (6) - directory? (18)
- dirname (18)
- dirs (6)
- each (12)
- echo (18)
- executable? (18)
-
executable
_ real? (18) - exist? (18)
- exists? (18)
- file? (18)
- flush (6)
- foreach (18)
- ftype (18)
- getwd (6)
- glob (18)
- grpowned? (18)
- input (6)
- inspect (6)
- jobs (12)
-
jobs
_ exist? (6) - join (18)
- kill (12)
-
kill
_ job (6) - link (18)
- lstat (18)
- mkdir (18)
- mtime (18)
- name (6)
- notify (30)
- open (18)
- out (18)
- owned? (18)
- pipe? (18)
- popd (6)
- popdir (6)
-
process
_ controller (6) - pushd (6)
- pushdir (6)
- pwd (6)
- readable? (18)
-
readable
_ real? (18) - readlink (18)
-
record
_ separator (6) - rehash (18)
- rename (18)
- rm (18)
- rmdir (18)
- setgid? (18)
- setuid? (18)
- sfork (6)
- shell (6)
- shellescape (11)
- shelljoin (11)
- shellsplit (11)
- size (18)
- size? (18)
- socket? (18)
- split (18)
- start (6)
-
start
_ import (6) - stat (18)
- sticky? (18)
-
super
_ each (6) - symlink (18)
- symlink? (18)
- system (18)
-
system
_ path (6) - tee (18)
- terminate (6)
- test (18)
-
to
_ a (6) -
to
_ s (6) - transact (18)
- truncate (18)
- umask (6)
- unlink (18)
- utime (18)
- verbose (6)
- verbose? (6)
- wait? (12)
-
wait
_ all _ jobs _ execution (6) -
waiting
_ job? (6) -
waiting
_ jobs (6) -
waiting
_ jobs _ exist? (6) - writable? (18)
-
writable
_ real? (18) - zero? (18)
- | (6)
検索結果
先頭5件
-
Shell
:: Filter # >(to) -> self (18114.0) -
toをフィルタの出力とする。 toが, 文字列ならばファイルに, IOオブジェクトであれ ばそれをそのまま出力とする。
...ルに,IOオブジェクトならばそれに出力します。
使用例
require 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") > File.open("tail.out", "w")
#(sh.tail("-n 3") < "/etc/passwd") > "tail.out" # と同じ.
}... -
Shell
:: Filter # >>(to) -> self (6102.0) -
toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。
...IOオブジェクトならばそれに出力します。
使用例
require 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> File.open("tail.out", "w") # でも同じ。
}... -
Shell
# transact { . . . } -> object (115.0) -
ブロック中で shell を self として実行します。
...ブロック中で shell を self として実行します。
例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact{
system("ls", "-l") | head > STDOUT
# transact の中では、
# sh.system("ls", "-l") | sh.head > STDOUT と同じとなる。
}... -
Shell
:: CommandProcessor # transact { . . . } -> object (114.0) -
ブロック中で shell を self として実行します。
...ブロック中で shell を self として実行します。
例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact{
system("ls", "-l") | head > STDOUT
# transact の中では、
# sh.system("ls", "-l") | sh.head > STDOUT と同じとなる。
}... -
Shell
:: Filter # transact { . . . } -> object (114.0) -
ブロック中で shell を self として実行します。
...ブロック中で shell を self として実行します。
例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact{
system("ls", "-l") | head > STDOUT
# transact の中では、
# sh.system("ls", "-l") | sh.head > STDOUT と同じとなる。
}... -
Shell
# system(command , *opts) -> Shell :: SystemCommand (109.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
:: CommandProcessor # system(command , *opts) -> Shell :: SystemCommand (108.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
:: Filter # <(src) -> self (108.0) -
srcをフィルタの入力とする。 srcが, 文字列ならばファイルを, IOオブジェクトであれ ばそれをそのまま入力とする。
...ばそれをそのまま入力とする。
@param src フィルタの入力を, 文字列もしくは,IO オブジェクトで指定します。
使用例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
(sh.head("-n 30") < "/etc/passwd") > "ugo.txt"
}... -
Shell
:: Filter # system(command , *opts) -> Shell :: SystemCommand (108.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
# [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (103.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
@see Kernel.... -
Shell
# append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (103.0) -
@todo
...@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。... -
Shell
# atime(filename) -> Time (103.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列か IO オブジェクトを指定します。
@see File.atime -
Shell
# basename(filename , suffix = "") -> String (103.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。
@see File.basename -
Shell
# blockdev?(file) -> bool (103.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#blockdev? -
Shell
# cat(*files) -> Shell :: Filter (103.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
# cd(path , &block) -> self (103.0) -
カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.
...レクトリを文字列で指定します.
@param block path で指定したディレクトリで行う操作をブロックで指定します.
使用例
require 'shell'
sh = Shell.new
sh.transact {
cd("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}... -
Shell
# chardev?(file) -> bool (103.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#chardev?