ライブラリ
- ビルトイン (77)
- shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (24)
クラス
-
ARGF
. class (77) - Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (24)
検索結果
先頭5件
-
Shell
# echo(*strings) -> Shell :: Filter (18138.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ェルコマンド 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(file + ".tee") >> "all.... -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (18138.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ェルコマンド 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(file + ".tee") >> "all.... -
Shell
:: Filter # echo(*strings) -> Shell :: Filter (18138.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ェルコマンド 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(file + ".tee") >> "all.... -
ARGF
. class # file -> IO (6154.0) -
現在開いている処理対象の File オブジェクト(または IO オブジェ クト)を返します。
...開いている処理対象の File オブジェクト(または IO オブジェ
クト)を返します。
$ echo "foo" > foo
$ echo "bar" > bar
$ ruby argf.rb foo bar
ARGF.file # => #<File:foo>
ARGF.read(5) # => "foo\nb"
ARGF.file # => #<File:bar>
ARGFが現在開いて... -
ARGF
. class # filename -> String (6119.0) -
現在開いている処理対象のファイル名を返します。
...は - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename # => "glark"... -
ARGF
. class # path -> String (3019.0) -
現在開いている処理対象のファイル名を返します。
...は - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename # => "glark"... -
Shell
# tee(file) -> Shell :: Filter (138.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...am 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) | tee(file... -
Shell
:: CommandProcessor # tee(file) -> Shell :: Filter (138.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...am 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) | tee(file... -
Shell
:: Filter # tee(file) -> Shell :: Filter (138.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...am 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) | tee(file... -
Shell
# cat(*files) -> Shell :: Filter (131.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...m 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) | tee(file... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (131.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...m 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) | tee(file... -
Shell
:: Filter # cat(*files) -> Shell :: Filter (131.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...m 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) | tee(file... -
ARGF
. class # getbyte -> Integer | nil (37.0) -
self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。
...のため、最初のファイルを最後まで読んだ後は次のファイルの内
容を返します。
$ echo "foo" > file1
$ echo "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getbyte # => 102
ARGF.getbyte # => 111
ARGF.getbyte # => 111
ARGF.getbyte # => 10
ARGF.getbyte # =... -
ARGF
. class # getc -> String | nil (37.0) -
self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。
...のため、最初のファイルを最後まで読んだ後は次のファイルの内
容を返します。
$ echo "foo" > file1
$ echo "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getc # => "f"
ARGF.getc # => "o"
ARGF.getc # => "o"
ARGF.getc # => "\n"
ARGF.getc # => "b"
ARGF....