cat main2.sh

[root@chefserver ~]# cat main2.sh
#!/bin/sh

while read line
do

arg1=`cat script.txt | awk '{print $1}'`

 

sh expect4.sh $arg1

if [ $? -eq 0 ]
then

echo "Success"

else
echo "ERROR"

fi

 

done<script.txt