クラス
- Array (1)
- Shell (57)
-
Shell
:: BuiltInCommand (1) -
Shell
:: CommandProcessor (62) -
Shell
:: Filter (70) -
Shell
:: ProcessController (13) -
Shell
:: SystemCommand (9) -
Shell
:: Void (1) - String (2)
キーワード
- < (1)
- >> (1)
- [] (3)
- active? (1)
-
active
_ job? (1) -
active
_ jobs (1) -
active
_ jobs _ exist? (1) -
add
_ schedule (1) - append (3)
- atime (2)
- basename (3)
- blockdev? (2)
- cat (3)
- chardev? (3)
- chdir (1)
- chmod (3)
- chown (3)
- command (1)
-
command
_ processor (1) - concat (2)
- ctime (2)
- cwd (1)
- debug (1)
- debug? (1)
- delete (3)
- dir (1)
-
dir
_ stack (1) - directory? (3)
- dirname (3)
- dirs (1)
- each (2)
- echo (3)
- executable? (2)
-
executable
_ real? (3) - exist? (2)
- exists? (2)
- file? (2)
- foreach (3)
- ftype (3)
- getwd (1)
- glob (3)
- grpowned? (3)
- input (1)
- inspect (1)
- jobs (2)
-
jobs
_ exist? (1) - join (3)
- kill (2)
-
kill
_ job (1) - link (2)
- lstat (2)
- mkdir (3)
- mtime (2)
- name (1)
- notify (4)
- open (3)
- out (2)
- owned? (2)
- pipe? (2)
- popdir (1)
-
process
_ controller (1) - pushdir (1)
- pwd (1)
- readable? (3)
-
readable
_ real? (3) - readlink (3)
-
record
_ separator (1) - rehash (3)
- rename (3)
- rm (3)
- rmdir (3)
- setgid? (2)
- setuid? (2)
- sfork (1)
- shell (1)
- shellescape (1)
- shelljoin (1)
- shellsplit (1)
- size (3)
- size? (3)
- socket? (2)
- split (3)
- start (1)
-
start
_ import (1) - stat (2)
- sticky? (2)
-
super
_ each (1) - symlink (2)
- symlink? (2)
- system (2)
-
system
_ path (1) - tee (3)
- terminate (1)
- test (3)
-
to
_ a (1) -
to
_ s (1) - transact (3)
- truncate (3)
- unlink (2)
- utime (3)
- verbose (1)
- verbose? (1)
-
wait
_ all _ jobs _ execution (1) -
waiting
_ job? (1) -
waiting
_ jobs (1) -
waiting
_ jobs _ exist? (1) - writable? (3)
-
writable
_ real? (3) - zero? (3)
- | (1)
検索結果
先頭5件
-
Shell
:: Filter # >(to) -> self (63343.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... -
Shell
# process _ controller -> Shell :: ProcessController (37510.0) -
@todo
@todo -
Shell
# readable _ real?(file) -> bool (36910.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#readable_real? -
Shell
:: SystemCommand # start _ import -> () (36907.0) -
@todo
@todo -
Shell
:: CommandProcessor # readable _ real?(file) -> bool (27907.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#readable_real? -
Shell
:: Filter # readable _ real?(file) -> bool (27907.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#readable_real? -
Shell
:: CommandProcessor # zero?(file) -> bool (27607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#zero? -
Shell
:: ProcessController # sfork(command) { . . . } -> [Integer , IO , IO] (27607.0) -
シンプルな fork です。
シンプルな fork です。
@param command コマンドを指定します。
@return [PID, 入力用 IO, 出力用 IO] からなる配列を返します。 -
Shell
:: Filter # >>(to) -> self (27307.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... -
Shell
# command _ processor -> Shell :: CommandProcessor (18910.0) -
@todo
@todo -
Shell
# transact { . . . } -> object (18646.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 (18643.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 (18643.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
# chardev?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#chardev? -
Shell
# dir _ stack -> [String] (18610.0) -
@todo
@todo -
Shell
# directory?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#directory? -
Shell
# dirname(filename) -> String (18610.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.dirname -
Shell
# dirs -> [String] (18610.0) -
@todo
@todo -
Shell
# executable _ real?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#executable_real? -
Shell
# foreach(path = nil , &block) -> () (18610.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
# grpowned?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#grpowned? -
Shell
# mkdir(*path) -> Array (18610.0) -
Dir.mkdirと同じです。 (複数可)
...ram path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end... -
Shell
# readable?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#readable? -
Shell
# readlink(path) -> String (18610.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path シンボリックリンクを表す文字列を指定します。
@see File.readlink -
Shell
# record _ separator -> String (18610.0) -
@todo
@todo -
Shell
# rehash -> {} (18610.0) -
登録されているシステムコマンドの情報をクリアします。 通常、使うことはありません。
登録されているシステムコマンドの情報をクリアします。
通常、使うことはありません。 -
Shell
# rename(from , to) -> 0 (18610.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param from ファイルの名前を文字列で与えます。
@param to 新しいファイル名を文字列で与えます。
@see File.rename -
Shell
# rmdir(*path) -> () (18610.0) -
Dir.rmdirと同じです。 (複数可)
Dir.rmdirと同じです。 (複数可)
@param path 削除するディレクトリ名を文字列で指定します。 -
Shell
# truncate(path , length) -> 0 (18610.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Shell
# verbose -> bool (18610.0) -
@todo
@todo -
Shell
# verbose? -> bool (18610.0) -
@todo
@todo -
Shell
# writable?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#writable? -
Shell
# writable _ real?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#writable_real? -
Shell
# zero?(file) -> bool (18610.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#zero? -
Shell
:: CommandProcessor # chardev?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#chardev? -
Shell
:: CommandProcessor # directory?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#directory? -
Shell
:: CommandProcessor # dirname(filename) -> String (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.dirname -
Shell
:: CommandProcessor # executable _ real?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#executable_real? -
Shell
:: CommandProcessor # foreach(path = nil , &block) -> () (18607.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
:: CommandProcessor # grpowned?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#grpowned? -
Shell
:: CommandProcessor # mkdir(*path) -> Array (18607.0) -
Dir.mkdirと同じです。 (複数可)
...ram path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end... -
Shell
:: CommandProcessor # readable?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#readable? -
Shell
:: CommandProcessor # readlink(path) -> String (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path シンボリックリンクを表す文字列を指定します。
@see File.readlink -
Shell
:: CommandProcessor # rehash -> {} (18607.0) -
登録されているシステムコマンドの情報をクリアします。 通常、使うことはありません。
登録されているシステムコマンドの情報をクリアします。
通常、使うことはありません。 -
Shell
:: CommandProcessor # rename(from , to) -> 0 (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param from ファイルの名前を文字列で与えます。
@param to 新しいファイル名を文字列で与えます。
@see File.rename -
Shell
:: CommandProcessor # rm(*filename) -> Integer (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.delete -
Shell
:: CommandProcessor # rmdir(*path) -> () (18607.0) -
Dir.rmdirと同じです。 (複数可)
Dir.rmdirと同じです。 (複数可)
@param path 削除するディレクトリ名を文字列で指定します。 -
Shell
:: CommandProcessor # truncate(path , length) -> 0 (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Shell
:: CommandProcessor # writable?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#writable? -
Shell
:: CommandProcessor # writable _ real?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#writable_real? -
Shell
:: Filter # chardev?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#chardev? -
Shell
:: Filter # directory?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#directory? -
Shell
:: Filter # dirname(filename) -> String (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.dirname -
Shell
:: Filter # executable _ real?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#executable_real? -
Shell
:: Filter # foreach(path = nil , &block) -> () (18607.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 # grpowned?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列か IO オブジェクトを指定します。
@see FileTest.#grpowned? -
Shell
:: Filter # mkdir(*path) -> Array (18607.0) -
Dir.mkdirと同じです。 (複数可)
...ram path 作成するディレクトリ名を文字列で指定します。
@return 作成するディレクトリの一覧の配列を返します。
使用例
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
p sh.mkdir("foo") #=> ["foo"]
rescue => err
puts err
end... -
Shell
:: Filter # readable?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#readable? -
Shell
:: Filter # readlink(path) -> String (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path シンボリックリンクを表す文字列を指定します。
@see File.readlink -
Shell
:: Filter # rehash -> {} (18607.0) -
登録されているシステムコマンドの情報をクリアします。 通常、使うことはありません。
登録されているシステムコマンドの情報をクリアします。
通常、使うことはありません。 -
Shell
:: Filter # rename(from , to) -> 0 (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param from ファイルの名前を文字列で与えます。
@param to 新しいファイル名を文字列で与えます。
@see File.rename -
Shell
:: Filter # rm(*filename) -> Integer (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.delete -
Shell
:: Filter # rmdir(*path) -> () (18607.0) -
Dir.rmdirと同じです。 (複数可)
Dir.rmdirと同じです。 (複数可)
@param path 削除するディレクトリ名を文字列で指定します。 -
Shell
:: Filter # truncate(path , length) -> 0 (18607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate -
Shell
:: Filter # writable?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#writable? -
Shell
:: Filter # writable _ real?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#writable_real? -
Shell
:: Filter # zero?(file) -> bool (18607.0) -
FileTest モジュールにある同名のクラスメソッドと同じです.
FileTest モジュールにある同名のクラスメソッドと同じです.
@param file ファイル名を表す文字列を指定します。
@see FileTest.#zero? -
Shell
:: ProcessController # active _ jobs -> Array (18607.0) -
実行中のジョブの配列を返します。
実行中のジョブの配列を返します。 -
Shell
:: ProcessController # jobs -> Array (18607.0) -
全てのジョブの配列を返します。
全てのジョブの配列を返します。 -
Shell
:: ProcessController # kill _ job(signal , command) -> Integer (18607.0) -
指定されたコマンドにシグナルを送ります。
指定されたコマンドにシグナルを送ります。
@param signal シグナルを整数かその名前の文字列で指定します。
負の値を持つシグナル(あるいはシグナル名の前に-)を指定すると、
プロセスではなくプロセスグループにシグナルを送ります。
@param command コマンドを指定します。
@see Process.#kill -
Shell
:: ProcessController # waiting _ jobs -> Array (18607.0) -
待機中のジョブを返します。
待機中のジョブを返します。 -
Shell
:: SystemCommand # start -> () (18607.0) -
@todo
@todo -
Shell
:: SystemCommand # super _ each -> () (18607.0) -
@todo
...@todo
Shell::Filter#each です。... -
Shell
:: SystemCommand # terminate -> () (18607.0) -
@todo
@todo -
Shell
:: ProcessController # active _ job?(job) -> bool (18307.0) -
指定されたジョブが実行中である場合は真を返します。 そうでない場合は偽を返します。
指定されたジョブが実行中である場合は真を返します。
そうでない場合は偽を返します。
@param job ジョブを指定します。 -
Shell
:: ProcessController # active _ jobs _ exist? -> bool (18307.0) -
実行中のジョブが存在する場合は真を返します。 そうでない場合は偽を返します。
実行中のジョブが存在する場合は真を返します。
そうでない場合は偽を返します。 -
Shell
:: ProcessController # add _ schedule(command) -> () (18307.0) -
指定されたコマンドを待機ジョブとして登録します。 ただし、実行中のジョブが存在しない場合は、そのジョブを直ちに実行します。
指定されたコマンドを待機ジョブとして登録します。
ただし、実行中のジョブが存在しない場合は、そのジョブを直ちに実行します。
@param command コマンドを指定します。 -
Shell
:: ProcessController # jobs _ exist? -> bool (18307.0) -
実行中か待機中のジョブが存在する場合は真を返します。 そうでない場合は偽を返します。
実行中か待機中のジョブが存在する場合は真を返します。
そうでない場合は偽を返します。 -
Shell
:: ProcessController # shell -> Shell (18307.0) -
@todo
@todo -
Shell
:: ProcessController # wait _ all _ jobs _ execution -> () (18307.0) -
全てのジョブの実行が終わるまで待ちます。
全てのジョブの実行が終わるまで待ちます。 -
Shell
:: ProcessController # waiting _ job?(job) -> bool (18307.0) -
指定されたジョブが存在する場合は真を返します。 そうでない場合は偽を返します。
指定されたジョブが存在する場合は真を返します。
そうでない場合は偽を返します。
@param job ジョブを指定します。 -
Shell
:: ProcessController # waiting _ jobs _ exist? -> bool (18307.0) -
待機中のジョブが存在する場合は真を返します。 そうでない場合は偽を返します。
待機中のジョブが存在する場合は真を返します。
そうでない場合は偽を返します。 -
Shell
:: Filter # <(src) -> self (9625.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
# chdir(path , &block) -> self (9610.0) -
カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.
...レクトリを文字列で指定します.
@param block path で指定したディレクトリで行う操作をブロックで指定します.
使用例
require 'shell'
sh = Shell.new
sh.transact {
cd("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}... -
Shell
# dir -> String (9610.0) -
カレントディレクトリのパスを文字列で返します。
...カレントディレクトリのパスを文字列で返します。
使用例
require 'shell'
sh = Shell.new
p sh.cwd
# 例
#=> "/Users/kouya/tall"... -
Shell
# popdir -> () (9610.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"... -
Shell
# pushdir(path = nil , &block) -> object (9610.0) -
カレントディレクトリをディレクトリスタックにつみ, カレントディレク トリをpathにする. pathが省略されたときには, カレントディレクトリと ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと きには, ブロック実行中のみpushdする.
...指定します。
@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... -
Shell
# rm(*filename) -> Integer (9610.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.delete -
Array
# shelljoin -> String (9607.0) -
配列の各要素である文字列に対して、Bourne シェルのコマンドライン中で安全に 使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド ライン文字列を生成します。
...スケープを適用し、空白文字を介してそれらを連結したコマンド
ライン文字列を生成します。
array.shelljoin は、Shellwords.shelljoin(array) と等価です。
@return エスケープ結果を連結した文字列を返します。
@see Shellwords.#shelljoin... -
Shell
:: CommandProcessor # [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (9607.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
:: CommandProcessor # append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (9607.0) -
@todo
...@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。... -
Shell
:: CommandProcessor # basename(filename , suffix = "") -> String (9607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。
@see File.basename -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (9607.0) -
実行すると, それらを内容とする 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) | te... -
Shell
:: CommandProcessor # chmod(mode , *filename) -> Integer (9607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@param mode chmod(2) と同様に整数で指定します。
@see File.chmod -
Shell
:: CommandProcessor # chown(owner , group , *filename) -> Integer (9607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param owner chown(2) と同様に数値で指定します。nil または -1 を指定することで、オーナーを現在のままにすることができます。
@param group chown(2) と同様に数値で指定します。nil または -1 を指定することで、グループを現在のままにすることができます。
@param filename ファイル名を表す文字列を指定します。
@see File.chown -
Shell
:: CommandProcessor # delete(*filename) -> Integer (9607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.delete -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (9607.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... -
Shell
:: CommandProcessor # expand _ path(path) -> String (9607.0) -
Fileクラスにある同名のクラスメソッドと同じです.
Fileクラスにある同名のクラスメソッドと同じです.
@param path ファイル名を表す文字列を指定します。
@see File.expand_path -
Shell
:: CommandProcessor # ftype(filename) -> String (9607.0) -
File クラスにある同名のクラスメソッドと同じです.
File クラスにある同名のクラスメソッドと同じです.
@param filename ファイル名を表す文字列を指定します。
@see File.ftype -
Shell
:: CommandProcessor # glob(pattern) -> Shell :: Filter (9607.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) | te...