getting a field from a line in awk/sed/?

Tom Christiansen tchrist at convex.COM
Fri Jan 11 01:06:07 AEST 1991


>From the keyboard of frechett at snoopy.Colorado.EDU (-=Runaway Daemon=-):
:Ah, yes, you are right, but there is a way.  How about if you know that the
:first column is only 12 characters wide... Something like 
:cut -c1-12 <<EOF
:in fact works quite well.  Granted, I would use awk or perl but
:cut has its uses too.  Of course there are those without cut but that 
:is their problem.

How it it our problem?  Cut isn't free, you know!

Honestly, I've never seen anyone do anything sufficently 
interesting about cut to justify paying for it, especially
since I've never seen any tricks that a straightforward 
awk or perl one-liner won't handle. Since I don't have it,
I don't really know, but this is my impression.

--tom



More information about the Comp.unix.questions mailing list