Quote:
Originally posted by jawemer
Thank you, Sathyaram.
cat ./users.txt | nawk '{print $2 " " $1}' > ./test_rev.txt
but getting error msg:
nawk: ./nawk_test.sh 1: not found
Is it wanting: ./nawk_test.sh ./file1.txt ./file2.txt ?
|
I think maybe your nawk in this case is an alias.
Try:
'nawk' '{print $2, $1}' users.txt > test_rev.txt # the single quotes wil prevent the shell using the alias.
or
unalias nawk; 'nawk' '{print $2, $1}' users.txt > test_rev.txt
or
/usr/bin/nawk '{print $2, $1}' users.txt > test_rev.txt
Or use awk.