You can use a case statement to get what you are after. For example:
#!/bin/bash
LOG=/dev/null
while read line; do
case ${line} in
'AIR DR')
LOG='air_dr.out'
;;
'AIR UR')
LOG='air_ur.out'
;;
'WATER DR')
LOG='water_dr.out'
;;
'WATER UR')
LOG='water_ur.out'
;;
*)
echo ${line} >> ${LOG}
;;
esac
done < results.txt
L7Sqr
Practically a Master Poster
657 posts since Feb 2011
Reputation Points: 201
Solved Threads: 124