Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなコマンドの出力をパイプしようとしています:
some_command | ruby -ne "puts $_ if some_condition($_)"
ただし、表示されるのは空の行だけです。各行はどこに保管されていますか?
これで問題なく動作するはずです。例として、ls | ruby -ne 'puts $_ if $_[0] == "r"'私が期待するものを印刷します。some_command実際に stdout に出力していることを確認する必要があります。
ls | ruby -ne 'puts $_ if $_[0] == "r"'
some_command