linux - use variable from while do loop bash -
i have while loop below using variable pov. need each line set variable can called in connection string, cant figure out how create loop feed each line separately.
wanting if [ ! -z $pov] .../shell execute using $pov... fi
each line in seq_fy.txt
what working with:
cat seq_fy.txt | while read pov; echo "pov$((n++))=$pov" ###wanting "if [ ! -z $pov] <execute> fi" each line in seq_fy.txt done $ ./while_loop_only pov0= pov1=spt_seq_010,fy15 pov2=spt_seq_010,fy16 pov3=spt_seq_020,fy15 pov4=spt_seq_020,fy16 pov5=spt_seq_030,fy15 pov6=spt_seq_030,fy16 pov7=spt_seq_040,fy15 pov8=spt_seq_040,fy16 pov9=spt_seq_050,fy15 pov10=spt_seq_050,fy16
looks have been way over-analyzing this.... don't need pov or exporting variables @ all, put command inside while loop , fed in $line, , seems work expected
cat fiename.txt | while read line; $owsdirectory"/hpm_ws_client.sh" processcalcscriptoptions "$appname" "$line" "$layers" "$stages" "" "$stages" "$stages" false > "$applogfolder""/""$line""_processid.log" done
Comments
Post a Comment