I've written a script and What I'm wanting to do is get it to run as fast as possible by using sub-processing or background-processing or what ever I need to use in order to speed up the computations.
So I was looking at using the & symbol in my script to simply speed up processing wherever I could, but when I put it in here, I don't get the results echo'ed to me.
This is the function that I have written and am trying to improve apon.
InTri(){
while read line
do
V1X=$(echo "$line" | awk '{print $1}') &
V1Z=$(echo "$line" | awk '{print $2}') &
V2X=$(echo "$line" | awk '{print $3}') &
V2Z=$(echo "$line" | awk '{print $4}') &
V3X=$(echo "$line" | awk '{print $5}') &
V3Z=$(echo "$line" | awk '{print $6}') &
run=$(echo "$line" | awk '{print $7}') &
wait
echo "$V1X $V1Z $V2X $V2Z $V3X $V3Z $run"
done < <(mysql -u root -ppassword LightCycle -N -e "SELECT V1X, V1Z, V2X, V2Z, V3X, V3Z, ID FROM Temp3 WHERE (V1X <= $x OR V2X <= $x OR V3X <= $x) AND (V1X >= $x OR V2X >= $x OR V3X >= $x) AND (V1Z <= $z OR V2Z <= $z OR V3Z <= $z) AND (V1Z >= $z OR V2Z >= $z OR V3Z >= $z);")
}
I've read the "man bash" (or what of it I could understand) but I don't understand why this is not working.
Help! :)
Thanks to anyone who can, your input is much appreciated.