Artificial intelligent assistant

Unix for loop and grep combined ksh hp-ux What if you have 5 or 6 files, specific files .biz in a directory, and you want to store them one at the time in a variable $file, and apply a set of command until no more .biz file are found in the directory. I tried to use for f in graham/quant do if grep "max" $file; then maximum.sh $file elif grep "milan" $file; then milan.sh $file elif grep "min" $file; then minimum.sh $file . . . else echo " keep working you are close " fi done but the program executes all the files with the first valid condition. If you have 5 files with .biz extension, all of them will be executed with first valid condition 5 times. the output will be : Milan Milan Milan Milan Milan instead of Milan Minimum Maximum . . Any ideas?

As the users says it is using **an ancient unix shell** , lets try another version of the script:


#!/bin/sh
#test version for ancient shell.
cd graham/quant
for file in *.biz
do
grep -q "max" "$file"
if [ "$?" = "0" ]; then
maximum.sh "$file"
fi

grep -q "milan" "$file"
if [ "$?" = "0" ]; then
milan.sh "$file"
fi

grep -q "min" "$file"
if [ "$?" = "0" ]; then
minimum.sh "$file"
fi


done
cd $OLDPWD

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 986e22520fad3962b935ac1c048689ec