我想在Solaris上使用tee命令將1個命令的輸出路由到2個不同的每個包含多個語句的不同的steamed。這是我編碼的片段,但不起作用。此迭代會引發有關意外文件結尾的錯誤。如果我將>更改爲|它會在意外令牌附近引發錯誤語法錯誤。開球到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
)
建議?
工作很好,謝謝。 – JimR