るりまサーチ

最速Rubyリファレンスマニュアル検索!
4238件ヒット [1-100件を表示] (0.032秒)

別のキーワード

  1. shell/builtin-command new
  2. shell/builtin-command each
  3. etc sc_shell
  4. shell cd
  5. shell debug

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Shell (38016.0)

Shell オブジェクトはカレントディレクトリを持ち, コマンド実行はそこからの相対パスになります.

...Shell オブジェクトはカレントディレクトリを持ち,
コマンド実行はそこからの相対パスになります....

Shell#append(to, filter) -> Shell::AppendFile | Shell::AppendIO (21208.0)

@todo

...@todo

@param to 文字列か IO を指定します。

@param filter Shell::Filter のインスタンスを指定します。...

Shell#system(command, *opts) -> Shell::SystemCommand (21125.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 (21125.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 (21119.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 (21119.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 (21119.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 (21119.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 (21117.0)

プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShellオ ブジェクトを生成します.

...プロセスのカレントディレクトリをpwd で指定されたディレクトリとするShell
ブジェクトを生成します.

@param pwd プロセスのカレントディレクトリをpwd で指定されたディレクトリとします。
指定しない場合は、Dir....

Shell#command_processor -> Shell::CommandProcessor (21101.0)

@todo

@todo

絞り込み条件を変える

Shell#concat(*jobs) -> Shell::Concat (21101.0)

@todo

@todo

Shell#process_controller -> Shell::ProcessController (21101.0)

@todo

@todo

Shell.def_system_command(command, path = command) -> nil (21058.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 (21046.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 (21046.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) (21046.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) -> () (21042.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("...
<< 1 2 3 ... > >>