10
比方說,我有一個bash函數函數可以作爲後臺作業在bash子shell中調用嗎?
Yadda() {
# time-consuming processes that must take place sequentially
# the result will be appended >> $OUTFILE
# $OUTFILE is set by the main body of the script
# No manipulation of variables in the main body
# Only local-ly defined variables are manipulated
}
我是否允許調用該函數作爲一個子shell後臺作業?例如:
OUTFILE=~/result
for PARM in $PARAMLIST; do
(Yadda $PARM) &
done
wait
cat $OUTFILE
您怎麼看?
試試看吧? – eggyal 2011-05-08 07:01:09
@eggyal不幸的是,我在家,Linux服務器在辦公室:P – pepoluan 2011-05-08 07:05:34