I am facing issue in looping in shell script. I have a requirement where i have to read the content from a flat file and substitue it word by word. For example:
file content is as below:
Test1 001
Test2 002
and my script is as follows:
#!/bin/sh
cd /directorypath/bin/
while read line; do
for word in $line; do
for word1 in $line; do
nohup ./startcmd.sh attribute1=$word attribute2=$word1
done
done
done < /directorypath/test1.txt
but the above snippet is not giving the desired output.
I need the output as below:
./startcmd Test1 001
./startcmd Test2 002
Can anyone please help me in the same.
Thanks
for word in $line; donested?