クラス
- Array (11)
- Shell (729)
-
Shell
:: AppendFile (12) -
Shell
:: AppendIO (12) -
Shell
:: BuiltInCommand (12) -
Shell
:: Cat (12) -
Shell
:: CommandProcessor (498) -
Shell
:: Concat (12) -
Shell
:: Echo (12) -
Shell
:: Filter (474) -
Shell
:: Glob (12) -
Shell
:: ProcessController (144) -
Shell
:: SystemCommand (96) -
Shell
:: Tee (12) -
Shell
:: Void (12) - String (22)
モジュール
- Shellwords (77)
キーワード
- + (6)
- < (6)
- > (6)
- >> (6)
- AppendFile (6)
- AppendIO (6)
- BuiltInCommand (6)
- CantApplyMethod (6)
- CantDefine (6)
- Cat (6)
- CommandNotFound (6)
- CommandProcessor (6)
- Concat (6)
- DirStackEmpty (6)
- Echo (6)
- Error (6)
- Filter (6)
- Glob (6)
- NoDelegateMethods (6)
- ProcessController (6)
- Shellwords (11)
- SystemCommand (6)
- Tee (6)
-
USING
_ AT _ EXIT _ WHEN _ PROCESS _ EXIT (6) - Void (6)
- [] (18)
- activate (6)
- active? (12)
-
active
_ job? (6) -
active
_ jobs (6) -
active
_ jobs _ exist? (6) -
active
_ process _ controllers (6) -
add
_ delegate _ command _ to _ shell (6) -
add
_ schedule (6) -
alias
_ command (18) -
alias
_ map (6) - append (18)
- atime (18)
- basename (18)
-
block
_ output _ synchronize (6) - blockdev? (18)
- cascade (6)
- cascade= (6)
- cat (18)
- cd (12)
- chardev? (18)
- chdir (6)
-
check
_ point (18) - chmod (18)
- chown (18)
- command (6)
-
command
_ processor (6) - concat (18)
- ctime (18)
- cwd (6)
- debug (12)
- debug= (12)
- debug? (12)
-
debug
_ output _ exclusive _ unlock (3) -
debug
_ output _ lock (6) -
debug
_ output _ locked? (6) -
debug
_ output _ synchronize (6) -
debug
_ output _ try _ lock (6) -
debug
_ output _ unlock (6) -
def
_ builtin _ commands (6) -
def
_ system _ command (12) -
default
_ record _ separator (6) -
default
_ record _ separator= (6) -
default
_ system _ path (6) -
default
_ system _ path= (6) - delete (18)
- dir (6)
-
dir
_ stack (6) - directory? (18)
- dirname (18)
- dirs (6)
- each (48)
-
each
_ active _ object (6) - echo (18)
- escape (11)
- executable? (18)
-
executable
_ real? (18) - exist? (18)
- exists? (18)
- file? (18)
-
find
_ system _ command (18) -
finish
_ all _ jobs (18) - flush (6)
- foreach (18)
- ftype (18)
- getwd (6)
- glob (18)
- grpowned? (18)
- identical? (18)
- inactivate (6)
- initialize (6)
- input (6)
- input= (24)
- inspect (6)
-
install
_ builtin _ commands (6) -
install
_ system _ commands (12) - jobs (12)
-
jobs
_ exist? (6) - join (29)
- kill (12)
-
kill
_ job (6) - link (18)
- lstat (18)
-
method
_ added (6) - mkdir (18)
- mtime (18)
- name (6)
- new (78)
- notify (36)
- open (18)
- out (18)
- owned? (18)
- pipe? (18)
- popd (6)
- popdir (6)
-
process
_ controller (6) -
process
_ controllers _ exclusive (6) - pushd (6)
- pushdir (6)
- pwd (6)
- readable? (18)
-
readable
_ real? (18) - readlink (18)
-
record
_ separator (6) -
record
_ separator= (6) - rehash (18)
- rename (18)
- rm (18)
- rmdir (18)
-
run
_ config (6) - setgid? (18)
- setuid? (18)
- sfork (6)
- shell (6)
- shellescape (22)
- shelljoin (22)
- shellsplit (22)
- shellwords (11)
- size (18)
- size? (18)
- socket? (18)
- split (29)
- start (6)
-
start
_ export (6) -
start
_ import (6) -
start
_ job (6) - stat (18)
- sticky? (18)
-
super
_ each (6) - symlink (18)
- symlink? (18)
- system (18)
-
system
_ path (6) -
system
_ path= (6) - tee (18)
- terminate (6)
-
terminate
_ job (6) - test (18)
-
to
_ a (6) -
to
_ s (6) - transact (18)
- truncate (18)
- umask (6)
- umask= (6)
-
unalias
_ command (12) -
undef
_ system _ command (12) - unlink (18)
- utime (18)
- verbose (12)
- verbose= (12)
- verbose? (12)
- wait? (12)
-
wait
_ all _ jobs _ execution (6) -
wait
_ to _ finish _ all _ process _ controllers (6) -
waiting
_ job? (6) -
waiting
_ jobs (6) -
waiting
_ jobs _ exist? (6) -
world
_ readable? (18) -
world
_ writable? (18) - writable? (18)
-
writable
_ real? (18) - zero? (18)
- | (6)
検索結果
先頭5件
-
Shell (38018.0)
-
Shell オブジェクトはカレントディレクトリを持ち, コマンド実行はそこからの相対パスになります.
...Shell オブジェクトはカレントディレクトリを持ち,
コマンド実行はそこからの相対パスになります.... -
Shell
# append(to , filter) -> Shell :: AppendFile | Shell :: AppendIO (21210.0) -
@todo
...@todo
@param to 文字列か IO を指定します。
@param filter Shell::Filter のインスタンスを指定します。... -
Shell
# system(command , *opts) -> Shell :: SystemCommand (21127.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
. undef _ system _ command(command) -> Shell :: CommandProcessor (21127.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
# cat(*files) -> Shell :: Filter (21121.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
# echo(*strings) -> Shell :: Filter (21121.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
# glob(pattern) -> Shell :: Filter (21121.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... -
Shell
# tee(file) -> Shell :: Filter (21121.0) -
実行すると, それらを内容とする 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) | te... -
Shell
. new(pwd = Dir . pwd , umask = nil) -> Shell (21119.0) -
プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShellオ ブジェクトを生成します.
...プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShellオ
ブジェクトを生成します.
@param pwd プロセスのカレントディレクトリをpwd で指定されたディレクトリとします。
指定しない場合は、Dir.... -
Shell
# command _ processor -> Shell :: CommandProcessor (21103.0) -
@todo
@todo -
Shell
# concat(*jobs) -> Shell :: Concat (21103.0) -
@todo
@todo -
Shell
# process _ controller -> Shell :: ProcessController (21103.0) -
@todo
@todo -
Shell
. def _ system _ command(command , path = command) -> nil (21060.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
. alias _ command(alias , command , *opts) { . . . } -> self (21048.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
. default _ system _ path -> Array (21048.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) (21048.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
. unalias _ command(alias) -> () (21044.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("...