ライブラリ
- shell (26)
キーワード
-
alias
_ command (1) - cascade (1)
- cascade= (1)
- cd (1)
- debug (1)
- debug= (1)
- debug? (1)
-
debug
_ output _ exclusive _ unlock (1) -
debug
_ output _ lock (1) -
debug
_ output _ locked? (1) -
debug
_ output _ synchronize (1) -
debug
_ output _ try _ lock (1) -
debug
_ output _ unlock (1) -
def
_ system _ command (1) -
default
_ record _ separator (1) -
default
_ record _ separator= (1) -
default
_ system _ path (1) -
default
_ system _ path= (1) -
install
_ system _ commands (1) - new (1)
- notify (1)
-
unalias
_ command (1) -
undef
_ system _ command (1) - verbose (1)
- verbose= (1)
- verbose? (1)
検索結果
先頭5件
-
Shell
. alias _ command(alias , command , *opts) { . . . } -> self (7.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
. cascade -> bool (7.0) -
@todo
@todo -
Shell
. cascade=(flag) (7.0) -
@todo
@todo -
Shell
. cd(path = nil , verbose = self . verbose) -> self (7.0) -
pathをカレントディレクトリとするShellオブジェクトを生成します.
...クトリとするShellオブジェクトを生成します.
@param path カレントディレクトリとするディレクトリを文字列で指定します。
@param verbose true を指定すると冗長な出力を行います。
使用例
require 'shell'
sh = Shell.new
sh.cd("/tmp")... -
Shell
. debug -> bool | Integer (7.0) -
@todo
@todo
デバッグ用フラグを参照します。 -
Shell
. debug=(val) (7.0) -
デバッグ用のフラグを設定します。
デバッグ用のフラグを設定します。
@param val bool 値や整数値を指定します。詳細は下記を参照してください。
# debug: true -> normal debug
# debug: 1 -> eval definition debug
# debug: 2 -> detail inspect debug -
Shell
. debug? -> bool | Integer (7.0) -
@todo
@todo
デバッグ用フラグを参照します。 -
Shell
. debug _ output _ exclusive _ unlock { . . . } -> Mutex | nil (7.0) -
@todo
@todo
@see Mutex#exclusive_unlock -
Shell
. debug _ output _ lock -> Mutex (7.0) -
@todo
@todo
@see Thread::Mutex#lock -
Shell
. debug _ output _ locked? -> bool (7.0) -
@todo
@todo
@see Thread::Mutex#locked? -
Shell
. debug _ output _ synchronize (7.0) -
@todo
@todo
@see Thread::Mutex#synchronize -
Shell
. debug _ output _ try _ lock -> bool (7.0) -
@todo
@todo
@see Thread::Mutex#try_lock -
Shell
. debug _ output _ unlock -> Mutex | nil (7.0) -
@todo
@todo
@see Thread::Mutex#unlock -
Shell
. def _ system _ command(command , path = command) -> nil (7.0) -
Shell のメソッドとして command を登録します.
...
Shell のメソッドとして command を登録します.
OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.
@param command Shell のメソッド......ない場合はcommand と同じになります。
例)
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... -
Shell
. default _ record _ separator -> String (7.0) -
執筆者募集
...執筆者募集
Shell で用いられる入力レコードセパレータを表す文字列を設定および参照します。
なにも指定しない場合は$/ の値が用いられます。
@param rs Shell で用いられる入力レコードセパレータを表す文字列を指定しま... -
Shell
. default _ record _ separator=(rs) (7.0) -
執筆者募集
...執筆者募集
Shell で用いられる入力レコードセパレータを表す文字列を設定および参照します。
なにも指定しない場合は$/ の値が用いられます。
@param rs Shell で用いられる入力レコードセパレータを表す文字列を指定しま... -
Shell
. default _ system _ path -> Array (7.0) -
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
...
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
@param path Shellでもちいられるコマンドを検索する対象のパスを文字列で指定します。
動作例
require 'shell'
p Shell.default_system_path
# 例
#=> [......"/opt/local/bin", "/opt/local/sbin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", "/usr/X11/bin", "/Users/kouya/bin"]
Shell.default_system_path = ENV["HOME"] + "/bin"
p Shell.default_system_path
# => "/Users/kouya/bin"... -
Shell
. default _ system _ path=(path) (7.0) -
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
...
Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。
@param path Shellでもちいられるコマンドを検索する対象のパスを文字列で指定します。
動作例
require 'shell'
p Shell.default_system_path
# 例
#=> [......"/opt/local/bin", "/opt/local/sbin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/bin", "/usr/X11/bin", "/Users/kouya/bin"]
Shell.default_system_path = ENV["HOME"] + "/bin"
p Shell.default_system_path
# => "/Users/kouya/bin"... -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (7.0) -
system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.
...イルをShellに定義する. メソッ
ド名は元のファイル名の頭にpreをつけたものとなる.
@param pre Shellに定義するメソッド名の先頭に付加される文字列を指定します。
使用例: ls -l | head -n 5 のような例。
require 'shell'
Shell.install......_system_commands
sh = Shell.new
sh.verbose = false
sh.transact {
(sys_ls("-l") | sys_head("-n 5")).each {|l|
puts l
}
}... -
Shell
. new(pwd = Dir . pwd , umask = nil) -> Shell (7.0) -
プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShellオ ブジェクトを生成します.
...プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShellオ
ブジェクトを生成します.
@param pwd プロセスのカレントディレクトリをpwd で指定されたディレクトリとします。
指定しない場合は、Dir.... -
Shell
. notify(*opts) {|message| . . . } -> String (7.0) -
@todo
@todo -
Shell
. unalias _ command(alias) -> () (7.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("... -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (7.0) -
commandを削除します.
...mmand 削除するコマンドの文字列を指定します。
動作例:
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
}
}
r... -
Shell
. verbose -> bool (7.0) -
@todo
@todo -
Shell
. verbose=(flag) (7.0) -
true ならば冗長な出力の設定を行います。
true ならば冗長な出力の設定を行います。
@param flag true ならば冗長な出力の設定を行います。 -
Shell
. verbose? -> bool (7.0) -
@todo
@todo