Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > shell/command-processorライブラリ > Shell::CommandProcessorクラス > echo

instance method Shell::CommandProcessor#echo

echo(*strings) -> Shell::Filter

実行すると, それらを内容とする 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(file + ".tee") >> "all.tee"
    }
  }
}
class Shell::CommandProcessor