help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specifying multiple separators via FS or the -F command line flag -


From: cga2000
Subject: Re: Specifying multiple separators via FS or the -F command line flag - addendum
Date: Sun, 02 Dec 2007 15:59:59 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

Here's a sample of how the multiple separators feature behaves:

[15:52:17][gavron@turki:~]$ echo " one: two:three :four five" | awk -F "[: ]" 
'{print "1 "$1; print "2 "$2; print "3 "$3; print "4 "$4; print "5 "$5; print 
"6 "$6;print "7 "$7;print "8 "$8}'
1
2 one
3
4 two
5 three
6
7 four
8 five

Doesn't seem very logical to me.  

When awk successfully tests for space or colon, the following characters
are assumed NOT to be separators even if they have been defined as such
via the -F flag -- eg. the <space> that follows "one:" is mapped to the
$3 variable.

Is this the way it's supposed to work?







reply via email to

[Prev in Thread] Current Thread [Next in Thread]