Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Simple awk just not working - please help

Avatar of jewbolt
jewbolt asked on
Unix OS
7 Comments1 Solution534 ViewsLast Modified:
I'm trying to get an awk to work that will look at a file that is | delimitered and print out a field value.
For some reason I can't get it to work and it keeps complaining about a missing } character.
As a test I tried some basic web samples, and they fail in a similar way.
root> sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }'
 syntax error The source line is 1.
 The error context is
                { FS = ":" >>>   <<<
 awk: The statement cannot be correctly parsed.
 The source line is 1.
        awk: There is a missing } character.

I'm running this on HP-UX B.11.31 U ia64, but I got the same error on a old SCO server too.

Can someone please put me out of my misery. I must be missing something very simple.


Avatar of omarfarid
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answers