On my local system, it appears that the configuration for awk has somehow been changed.
Running the following command:
echo "Hi there" | awk '{print $2}'
On my machine this prints:
Hi there
And on my development server it prints:
there
I am sure that at some point my local machine would behave the same as my server - i.e. it should print only the second word.
How do I reset the awk field separator back to its default (which according to this page is a sequence of spaces)?
$2to collapse to nothing, printing the whole line. – Ignacio Vazquez-Abrams May 12 '11 at 16:15echo Hi there | awk '{print $2}'– ceving May 12 '11 at 16:16