This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: use of cut in guile-doc-snarf


Brad Knotwell <knotwell@ix.netcom.com> writes:

> Hello all--
> 
> I was poking around at guile-doc-snarf and figured out why it takes such
> a long time.  In general, the following sed command takes an extremely
> long time to complete:
> 
>      sed 's/^\(.\{128\}.\{128\}.\{128\}.\{128\}.\{128\}.\{128\}.\{128\}.\{128\}\).*/\1/g'
> 
> As far as I can tell, the whole purpose of this command is to cut a line down
> to 1024 characters in length.  Is there any reason not to do something like
> the following instead:
> 
>     cut -c1-1023

no reason, except the fact that I didn't know about this `cut' thing.

duh!

is the invocation you suggest above reasonably portable?  (the whole
`sed' exercise was done to circumvent the line length restriction in
Solaris nawk, and now I just _expect_ such idiocies to lurk in every
Unix tool I use).

-- 
You have a tendency to feel you are superior to most computers.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]