From: shugo@... (Shugo Maeda) Date: 1997-10-24T01:21:22+09:00 Subject: [ruby-list:5123] Re: how to get results of command 前田です。 In message "[ruby-list:5122] how to get results of command" Yasuhiro Abe wrote: |あるperlスクリプトをrubyスクリプトの中で実行して、その |perlスクリプトの結果を表示するプログラムを書きたいのですが、 |どのようにしたらよいのでしょう。 |#今はjweblint gatewayを書いているのです。 | |system()もexec()もプログラムを実行するだけのようなので |実行したプログラムの出力をどう受けとったらいいのか、 |さっぱりわからないのです。 result = `command arg1 arg2 ...` のようにバッククォートを使うと標準出力を受けとることができます。 あるいは, cmd = open("| command arg...") のようなのもよく使われます。 -- 前田 修吾