![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SED command to change ./ to a space | bobk544 | Shell Programming and Scripting | 11 | 04-05-2007 09:46 AM |
| To display 1 or 2 space bar output | missutoomuch | Shell Programming and Scripting | 2 | 02-11-2006 04:25 PM |
| Command to list used space in VG? | Stephan | UNIX for Dummies Questions & Answers | 2 | 11-03-2005 03:34 PM |
| Preserving space during command substitution | Sabari Nath S | UNIX for Dummies Questions & Answers | 1 | 10-04-2005 10:16 AM |
| How to trim space in output variable ? | vj_76 | Shell Programming and Scripting | 5 | 06-12-2005 04:03 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
space in output from awk command
Hi
I have tried this command cat /etc/passwd | awk -F: '{print$5}' note that the $5 is the column that displays full name- i.e. Kevin Kambell To the point, my output is fine except one thing I do not understand that some of output lines have space in front of them which I checked in /etc/passwd and there were no space before those names. For example: Matt damon Ben Jones -Kevin Kambell Steward Note Joke Chain -William Ink (Note that "-" is the space in the real output However, the output has no space if I use the command: awk -F: '{print$5}' /etc/passwd the output was shown as follows: Matt damon Ben Jones Kevin Kambell Steward Note Joke Chain William Ink Thanks a lot Last edited by lalelle; 08-13-2007 at 05:47 PM.. Reason: Spaces were trimmed |
|
||||
|
Quote:
I am sorry. I am very new to awk. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|