[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/
- using mapfile is extreamly slow compared to oldfashinod ways to read files, Lennart Schultz, 2009/03/26
- Re: using mapfile is extreamly slow compared to oldfashinod ways to read files, Greg Wooledge, 2009/03/26
- Re: using mapfile is extreamly slow compared to oldfashinod ways to read files, Chet Ramey, 2009/03/26
- Re: using mapfile is extreamly slow compared to oldfashinod ways to read files, Chris F.A. Johnson, 2009/03/26
- Re: using mapfile is extreamly slow compared to oldfashinod ways to read files,
Chet Ramey <=
- Message not available
- Re: using mapfile is extreamly slow compared to oldfashinod ways to read files, Greg Wooledge, 2009/03/27
- Re: using mapfile is extreamly slow compared to oldfashinod ways to read files, Lennart Schultz, 2009/03/27