ライブラリ
- ビルトイン (30)
- shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (24)
クラス
- Array (19)
- Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (24) - String (11)
検索結果
先頭5件
-
Shell
# echo(*strings) -> Shell :: Filter (18120.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ings シェルコマンド 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")... -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (18120.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ings シェルコマンド 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")... -
Shell
:: Filter # echo(*strings) -> Shell :: Filter (18120.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ings シェルコマンド 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")... -
Array
# pack(template) -> String (73.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...に _ または ! を "s_" あるいは "s!" のように
続けることでシステム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられな......造体を渡すときのように、
システム依存のサイズとエンディアンに合わせる必要があるときには
s!, S!, i!, I!, l!, L!, q!, Q!, j!, J! を用います。
また、ネットワークプロトコルやファイルフォーマットのように、
システムに依......ディアンを指定したいときは、
リトルエンディアンなら < を、
ビッグエンディアンなら >
を後ろにつけます。! と組み合わせることも可能です。
まとめると以下のようになります。
: エンディアン非依存、整数サイズ非......ズ(capacity)が足りなければ、packはメモリを確保します。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックするためのテンプレートを文... -
Array
# pack(template , buffer: String . new) -> String (73.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...ズ(capacity)が足りなければ、packはメモリを確保します。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックするためのテンプレートを文......に _ または ! を "s_" あるいは "s!" のように
続けることでシステム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられな......造体を渡すときのように、
システム依存のサイズとエンディアンに合わせる必要があるときには
s!, S!, i!, I!, l!, L!, q!, Q!, j!, J! を用います。
また、ネットワークプロトコルやファイルフォーマットのように、
システムに依... -
String
# unpack(template) -> Array (73.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...に _ または ! を "s_" あるいは "s!" のように
続けることでシステム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられな......造体を渡すときのように、
システム依存のサイズとエンディアンに合わせる必要があるときには
s!, S!, i!, I!, l!, L!, q!, Q!, j!, J! を用います。
また、ネットワークプロトコルやファイルフォーマットのように、
システムに依......ディアンを指定したいときは、
リトルエンディアンなら < を、
ビッグエンディアンなら >
を後ろにつけます。! と組み合わせることも可能です。
まとめると以下のようになります。
: エンディアン非依存、整数サイズ非... -
Shell
# cat(*files) -> Shell :: Filter (13.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ファイル名を文字列で指定します。
動作例
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.tee"
}
}
}... -
Shell
# glob(pattern) -> Shell :: Filter (13.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) | tee(file + ".tee") >> "all.tee"
}
}
}
@see Dir.[]... -
Shell
# tee(file) -> Shell :: Filter (13.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...るファイル名を文字列で指定します。
動作例
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.tee"
}
}
}... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (13.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ファイル名を文字列で指定します。
動作例
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.tee"
}
}
}... -
Shell
:: CommandProcessor # glob(pattern) -> Shell :: Filter (13.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) | tee(file + ".tee") >> "all.tee"
}
}
}
@see Dir.[]... -
Shell
:: CommandProcessor # tee(file) -> Shell :: Filter (13.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...るファイル名を文字列で指定します。
動作例
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.tee"
}
}
}... -
Shell
:: Filter # cat(*files) -> Shell :: Filter (13.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ファイル名を文字列で指定します。
動作例
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.tee"
}
}
}... -
Shell
:: Filter # glob(pattern) -> Shell :: Filter (13.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) | tee(file + ".tee") >> "all.tee"
}
}
}
@see Dir.[]... -
Shell
:: Filter # tee(file) -> Shell :: Filter (13.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...るファイル名を文字列で指定します。
動作例
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.tee"
}
}
}...