I have a script that runs against a file and that takes arguments from a user and is sent through grep and awk to get the desired column. It will return multiple lines. What I want to do is read (or something of the like) through the output from grep|awk and run that through another script (./lookup). My question is how can I loop through each line and run what is on that line through my script inside the script. Hope this makes sense, I'm new to scripting and linux.
#!/bin/sh
x=$(grep "$*" "$c"|awk '{print $6}')
while read LINE
do
./lookup $x
done
This seems to work but only for the first line of the output. It also requires me to hit enter to get the output from the ./lookup script. Any ideas or help? Thanks!