Hello I have 2 files with the first file containing a few values for example
powershell
vectormaps
JuniperSA
and the second file containing values and and ID
appid uid
SplunkforSnort 340
powershell 610
vectormaps 729
JuniperSA 826
postfix 933
SplunkforJuniperSRX 929
TA-barracuda_webfilter 952
TA-dragon-ips 954
dhcpd 392
So im trying to run a while loop with AWK to get the values and their corresponding ID's but the output file seems to be writing something else. This is how im trying to run the while loop.
while read $line;
do
awk '/'$line'/ {print $0}' file2.csv > new
done < file1
My expected output should be
powershell 610
vectormaps 729
JuniperSA 826
but my output is
appid uid
SplunkforSnort 340
powershell 610
vectormaps 729
JuniperSA 826
postfix 933
SplunkforJuniperSRX 929
TA-barracuda_webfilter 952
TA-dragon-ips 954
dhcpd 392
it seems as if nothing is happening. What am i missing here?