"R. Bernstein" wrote: > > I'd like to a read potentially large files (a zsh script file) into an > array fast. It is not uncommon for a GNU autoconf configure script to > be tens of thousands of lines long. (As an example, The zsh configure > script is over 20,000 lines long). > > I know about redirecting input in a loop and/or alternatively using > "read" in a loop. But for a large file this tends to be slow. As a > result, both bash and zsh have a mechanism for doing this faster than > using a read loop.
Do you have any examples for the "bash" and "zsh" syntax ? > For zsh the speed difference was 0.189 seconds (to > load zsh and the module and read) versus over a minute. For bash the > difference in speeds is, I believe, even greater. > > So what's the fastest way to large read a file into an array? How should the file be read into the array ? One array element per line ? ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [EMAIL PROTECTED] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
