Digamos que tengo una función fiesta¿Se puede invocar una función en una subshell bash como trabajo de fondo?
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
}
¿Se me permite invocar la función como un trabajo en segundo plano en un subnivel? P. ej .:
OUTFILE=~/result
for PARM in $PARAMLIST; do
(Yadda $PARM) &
done
wait
cat $OUTFILE
¿Qué opinas?
Pruébalo y mira? – eggyal
@eggyal desafortunadamente, estoy en casa, y el servidor Linux está en la oficina: P – pepoluan