I have a pre process command to output a file
./preprocess.sh > preprocessed_file
and the preprocessed_file
will be used like this
while read line
do
./research.sh $line &
done < preprocessed_file
rm -f preprocessed_file
Is there any way to direct the output to the while read line
part instead of outputting to the preprocessed_file? I think there should be a better way other than using this temp preprocessed_file
.
You can use bash process substitution:
while IFS= read -r line; do
./research.sh "$line" &
done < <(./preprocess.sh)
Some advantages of process substitution:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments