るりまサーチ

最速Rubyリファレンスマニュアル検索!
183件ヒット [1-100件を表示] (0.036秒)
トップページ > クエリ:end[x] > クエリ:shell[x]

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. range end

検索結果

<< 1 2 > >>

shell (38126.0)

Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。

...は Ruby の機能を用いて実現します。

=== サンプル

==== Example 1:

require 'shell'
sh = Shell.cd("/tmp")
sh.mkdir "shell-test-1" unless sh.exists?("shell-test-1")
sh.cd("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
unless sh.exists?(dir)
sh.mkdir dir...
...w")
f.puts "TEST"
f.close
end
print sh.pwd
end

end


==== Example 2:

require 'shell'
sh = Shell.cd("/tmp")
sh.transact do
mkdir "shell-test-1" unless exists?("shell-test-1")
cd("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
if !exists?(d...
...cd(dir) do
f = open("tmpFile", "w")
f.print "TEST\n"
f.close
end

print pwd
end

end

end


==== Example 3: Using Pipe

require 'shell'
sh = Shell.new
sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
(sh.cat < "/etc/printcap") | sh.te...

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

@todo

...@todo

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

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

Shell.undef_system_command(command) -> Shell::CommandProcessor (17131.0)

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.unalias_command(alias) -> () (17048.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("...
...lsla")
rescue NameError => err
puts err
end
...

Shell#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (17024.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", "foo"] # => tru...

絞り込み条件を変える

Shell#mkdir(*path) -> Array (17024.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#test(command, file1, file2 = nil) -> bool | Time | Integer | nil (17024.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", "foo"] # => tru...

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

@todo

...@todo

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

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

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

@todo

...@todo

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

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

Shell::AppendFile (9000.0)

絞り込み条件を変える

Shell::AppendIO (9000.0)

Shell::AppendFile#input=(filter) (6000.0)

@todo

@todo

Shell::AppendFile.new(sh, filename) (6000.0)

@todo

@todo

Shell::AppendIO#input=(filter) (6000.0)

@todo

@todo

Shell::AppendIO.new(sh, filename) (6000.0)

@todo

@todo

絞り込み条件を変える

Shell::Filter#|(filter) -> object (3042.0)

パイプ結合を filter に対して行います。

...て行います。

@param filter Shell::Filter オブジェクトを指定します。

@return filter を返します。

使用例
require 'shell'
Shell
.def_system_command("tail")
Shell
.def_system_command("head")
Shell
.def_system_command("wc")
sh = Shell.new
sh.transact {
i = 1...
...while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i += 1
end

}...

Shell::CommandProcessor#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (3024.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", "foo"] # => tru...
<< 1 2 > >>