Shell script hangs on awk command
<p>This is what my script looks like essentially</p>

<pre><code>        ......
        rowNum=$(awk '{print NF}' temp)
        i=1
        while [ $i -lt $rowNum ]
        do
                echo "$rowNum"
                echo "$i"
                echo "$j"
                awk -v text=$(awk -v numb=$i '{print $numb}' temp) -v num=$j 'BEGIN{FS=","} $1 ~ text {print $num}' &gt; temp${i}
                echo "testing flag"
                i=$(expr $i + 1)
        done
        ......
</code></pre>

<p>When I run it I get </p>

<pre><code>101
1
3
</code></pre>

<p>And then it just hangs with "awk * script.sh text.txt" written on the tab of the terminal continuously so it's definately just hanging on the awk command but I can't figure out how to fix it. </p>

<p>Thank-you</p>