Hi2all,
I have file 1 which contents are:
#PTEDFLE 10.228.101.180
#PTEDFL8 10.228.101.180
#PTEDFLB 10.228.101.180
#PTEDFLF 10.228.101.176
#PTEDFLP 10.228.101.154
#PTEDFLN 10.228.101.154
#PTEDFLM 10.228.101.154
and other file 2 which holds data from first column of file 1.
I want to append with ip address (2nd column of file 1) every line in file 2 which contain column 1 in file 1.
This doesn't work:
while read term ip
do sed '/$term/ a\ $ip' 2 > test
done < 1
But if I try with appending only one value like this, it works:
sed '/#PTEDFLE/ a\ 10.228.101.180 2 >test
What am I missing??
I have file 1 which contents are:
#PTEDFLE 10.228.101.180
#PTEDFL8 10.228.101.180
#PTEDFLB 10.228.101.180
#PTEDFLF 10.228.101.176
#PTEDFLP 10.228.101.154
#PTEDFLN 10.228.101.154
#PTEDFLM 10.228.101.154
and other file 2 which holds data from first column of file 1.
I want to append with ip address (2nd column of file 1) every line in file 2 which contain column 1 in file 1.
This doesn't work:
while read term ip
do sed '/$term/ a\ $ip' 2 > test
done < 1
But if I try with appending only one value like this, it works:
sed '/#PTEDFLE/ a\ 10.228.101.180 2 >test
What am I missing??