trying to write a script for installing applications based on input from a file. the file is in format 'column1',<tab>'column2'.
Values from each column get used as imput at different places in the command. here's what i've started with.
CODE snippet
for port in `cat $1|awk '{print $1, $2}'`|read var1 var2
do
printf "\n \n Creating components for $var1 \n"
COMMAND $var1
when_error "check $LOG for errors"
COMMAND PATH/$var2.ear $var2 $var1
when_error "check $LOG for errors"
done
I've tried this several different ways. each line needs to be read one at a time till EOF....what's the best approach i should be take?
Values from each column get used as imput at different places in the command. here's what i've started with.
CODE snippet
for port in `cat $1|awk '{print $1, $2}'`|read var1 var2
do
printf "\n \n Creating components for $var1 \n"
COMMAND $var1
when_error "check $LOG for errors"
COMMAND PATH/$var2.ear $var2 $var1
when_error "check $LOG for errors"
done
I've tried this several different ways. each line needs to be read one at a time till EOF....what's the best approach i should be take?