323件ヒット
[1-100件を表示]
(0.109秒)
種類
- インスタンスメソッド (221)
- モジュール関数 (44)
- 特異メソッド (36)
- 文書 (22)
ライブラリ
- ビルトイン (44)
- rake (11)
- shell (54)
-
shell
/ command-processor (60) -
shell
/ filter (78) -
shell
/ system-command (54)
クラス
- Shell (54)
-
Shell
:: CommandProcessor (60) -
Shell
:: Filter (78) -
Shell
:: SystemCommand (54)
キーワード
- < (6)
- > (6)
- >> (6)
- cat (18)
- command (6)
-
def
_ system _ command (6) -
default
_ system _ path (6) - echo (18)
- glob (18)
-
install
_ system _ commands (12) - kill (6)
- name (6)
- notify (12)
- out (12)
-
ruby 1
. 9 feature (11) - spawn (44)
- start (6)
-
start
_ import (6) -
super
_ each (6) -
system
_ path (6) - tee (18)
- terminate (6)
-
to
_ a (6) -
to
_ s (6) - transact (18)
-
undef
_ system _ command (12) - | (6)
- 環境変数 (11)
検索結果
先頭5件
-
Shell
:: CommandProcessor # system(command , *opts) -> Shell :: SystemCommand (24443.0) -
command を実行する.
....
@param 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 # system(command , *opts) -> Shell :: SystemCommand (24443.0) -
command を実行する.
....
@param 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
:: SystemCommand # start _ import -> () (18300.0) -
@todo
@todo -
FileUtils
# sh(*cmd) {|result , status| . . . } (18231.0) -
与えられたコマンドを実行します。
...。
@param cmd 引数の解釈に関しては Kernel.#exec を参照してください。
例:
sh %{ls -ltr}
sh 'ls', 'file with spaces'
# check exit status after command runs
sh %{grep pattern file} do |ok, res|
if ! ok
puts "pattern not found (status = #{res.exit......status})"
end
end
@see Kernel.#exec, Kernel.#system... -
Shell
:: CommandProcessor . install _ system _ commands(prefix = "sys _ ") -> () (12301.0) -
全てのシステムコマンドをメソッドとして定義します。
...うプレフィクスが付きます。
また、メソッド名として使用できない文字は全て "_" に置換してメソッドを定義します。
このメソッドの実行中に発生した例外は単に無視されます。
@param prefix プレフィクスを指定します。... -
Shell
:: CommandProcessor . def _ system _ command(command , path = command) -> () (12201.0) -
@todo
...@todo
与えられたコマンドをメソッドとして定義します。
@param command 定義したいコマンドを指定します。
@param path command のパスを指定します。省略すると環境変数 PATH から command を探します。... -
Shell
:: CommandProcessor . undef _ system _ command(command) -> self (12201.0) -
与えられたコマンドを削除します。
...与えられたコマンドを削除します。
@param command 削除したいコマンド名を指定します。... -
Shell
:: SystemCommand # start -> () (12200.0) -
@todo
@todo -
Shell
:: SystemCommand # super _ each -> () (12200.0) -
@todo
...@todo
Shell::Filter#each です。... -
Shell
:: SystemCommand # terminate -> () (12200.0) -
@todo
@todo -
Shell
. undef _ system _ command(command) -> Shell :: CommandProcessor (9425.0) -
commandを削除します.
...除します.
@param command 削除するコマンドの文字列を指定します。
動作例:
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
}
}
rescue NameError => err
puts err
end... -
Shell
. install _ system _ commands(pre = "sys _ ") -> () (9353.0) -
system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.
...
system_path上にある全ての実行可能ファイルを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
# system _ path -> Array (9332.0) -
コマンドサーチパスの配列を返す。
...コマンドサーチパスの配列を返す。
@param path コマンドサーチパスの配列を指定します。
使用例
require 'shell'
sh = Shell.new
sh.system_path = [ "./" ]
p sh.system_path #=> ["./"]... -
Shell
. default _ system _ path -> Array (9320.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
# transact { . . . } -> object (9242.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 (9242.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 と同じとなる。
}...