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.
パイプ経由でデータを転送し、このデータを含むファイルも転送する必要があります。スクリプト内でこのようなことを行うことはできますか?
cat ${1} | ./helper ${1}
そして、私が書いた場合の違いは何ですか
cat ${1} | ./helper < ${1}
「<」は、ファイルの内容をスクリプトの標準入力に追加します
パイプは、./helper スクリプトの stdin の出力もリダイレクトします
${1} がファイル名であり、ヘルパー スクリプトで /dev/stdin からアクセスすると仮定cat ${1} | ./helper することもできます./helper < ${1}
cat ${1} | ./helper
./helper < ${1}