itsme_asif
asked on
Shell Script to loop through a file
Hi Experts,
Have a dumb question, i have the following script which loops through a file and takes the word in each line of that file and does a grep on a different file, however instead of grep'ing through every single line it only gives the grep output of the last line.
Have a dumb question, i have the following script which loops through a file and takes the word in each line of that file and does a grep on a different file, however instead of grep'ing through every single line it only gives the grep output of the last line.
#!/usr/bin/sh
# Loop through the file
for i in `cat inp.txt`
do
echo $i
grep $i it_privilege-export.csv|awk -F "," '{print $1}'
done
exit 0;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER