After the last post, I was interested in playing around with "awk." What I am trying to do now is choose a random number, and have "awk" use that random number for the line it will chose from a text file. What is happening is I am getting a constant loop of the whole text file...I got the code from " it the count that is doing this?
Code:
#!/bin/bash
MAXCOUNT=10
count=1
while [ "$count" -le $MAXCOUNT ]
do
number=$RANDOM
NAME=$(cat /home/eric/names | /usr/bin/awk '{print $number}')
echo $NAME
done