I have a file, xxx.lst with the following data:
aaa 111
bbb 222
ccc 333
I need to make 3 files called 111.lst, 222.lst and 333.lst respectively
with
aaa in 111.lst
bbb in 222.lst
and
ccc in 333.lst
I tried something like this:
for x in $(cat xxx.lst|awk '{print $1}');do
for y in $(cat xxx.lst|awk '{print $2}'|cut -d_ -f3|sort|uniq);do
echo $x > $y.lst
done
done
but it gives me ccc in all 3 files