るりまサーチ

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

別のキーワード

  1. kernel system
  2. _builtin system
  3. socket pf_system
  4. socket af_system
  5. socket eai_system

モジュール

キーワード

検索結果

<< < ... 5 6 7 >>

Shell::Filter#tee(file) -> Shell::Filter (7.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) |...

Shell::Filter#to_a -> [String] (7.0)

実行結果を文字列の配列で返します。

...実行結果を文字列の配列で返します。

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a...

Shell::Filter#to_s -> String (7.0)

実行結果を文字列で返します。

...実行結果を文字列で返します。

require 'shell'
Shell.def_system_command("wc")
sh = Shell.new

sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}...

String#sum(bits = 16) -> Integer (7.0)

文字列の bits ビットのチェックサムを計算します。

...{
def sum(bits)
sum = 0
each_byte {|c| sum += c }
return 0 if sum == 0
sum & ((1 << bits) - 1)
end
//}

例えば以下のコードで UNIX System V の
sum(1) コマンドと同じ値が得られます。

//emlist[例][ruby]{
sum = 0
ARGF.each_line do |line|
sum += line.sum
end
sum %= 65...
<< < ... 5 6 7 >>