Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk - change field separator

Status
Not open for further replies.

georgeocrawford

Technical User
Aug 12, 2002
111
GB
Hi,

I'm piping the results of an
Code:
ls -l
into this awk command:

Code:
awk '{print $9"\tF\t"$5}'

However, when this is run on a filename with a space in it, I just get the first word of the filename printed.

I think I need to change the default field separator from whitespace to just tabs - is that correct? If so:

Code:
awk 'BEGIN { FS = "\t" } ; { print $9"\tF\t"$5}'

which I tried, but it doesn't work (prints nothing).

Can someone please help with my command-line syntax for awk!

______________________

George
 

it's absolute.

Thanks again for the proof-read!


______________________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top