Solarisでteeコマンドを使用して、1つのコマンドの出力をそれぞれが複数のステートメントで構成される2つの異なるスチームにルーティングしようとしています。これが私がコーディングしたもののスニペットですが、機能しません。この反復により、予期しないファイルの終わりに関するエラーがスローされます。>を|に変更すると 予期しないトークンの近くでエラー構文エラーがスローされます。
todaydir=/some/path
baselen=${#todaydir}
grep sometext $todaydir/somefiles*
while read iline
tee
>(
# this is the first block
do ojob=${iline:$baselen+1:8}
echo 'some text here' $ojob
done > firstoutfile
)
>(
# this is the 2nd block
do ojob=${iline:$baselen+1:8}
echo 'ls -l '$todaydir'/'$ojob'*'
done > secondoutfile
)
提案?