bug-bash
[Top][All Lists]
Advanced

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

Re: using mapfile is extreamly slow compared to oldfashinod ways to read


From: Chet Ramey
Subject: Re: using mapfile is extreamly slow compared to oldfashinod ways to read files
Date: Thu, 26 Mar 2009 21:22:40 -0400
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Chris F.A. Johnson wrote:

>    Chet, how about an option to mapfile that strips leading and/or
>    trailing spaces?
> 
>    Another useful option would be to remove newlines.

I'm disinclined to add one, since it's easy enough to use the
${line##[       ]} and ${line%%[        ]} constructs to remove
leading and trailing whitespace.  You can use the same expansions
or pattern substitution to remove newlines (using $'\n' to denote
a newline).

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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