Sorry if this is something obvious, but I can't get this script to work:
cat $iniconf |while read x1 x2 x3 x4; do
echo $i $x1 $x2 $x3 $x4
if [ $i -eq 2 ]; then
echo $npore $ngau
If I echo npore and ngau in the loop, it works fine. Once it breaks the loop, the variables return blanks. What's the deal?
The input file contains values separated by spaces, and I need to extract the 3rd and 4rd on the 2nd line.