James Carlson wrote:
> Roland Mainz writes:
> > 2. Erm, wouldn't it be better to filter the comment lines directly after
> > the "cat", e.g. turn...
> [...]
> > + cat "${ORIG}" | grep '^[^#]' | while read line; do
> [...]
> > ... AFAIK this would avoid a |fork()|/|exec()| of "grep" for each line
> > (I ignore the extra "cat" in this case :-) ) ...
>
> Why not get rid of the uuoc as well? Using '< "$ORIG"' would be
> equivalent.
Groan... yes... but I don't really care about that little detail (e.g.
one "cat" vs. many many "grep").
At some point I hope we can simply use ksh93 instead of ksh88 and then
rewrite some of this things with better stuff, e.g.
use $ [[ ${line} = ~(El)# ]] && continue # (short explanation: ksh93
supports "alternative" patterns via ~(mod)patterm, e.g. in this case
mod="El" which means "extended regular expressions with left anchor"
("mod" can contain more modifiers, currently supported are POSIX shell
pattern, korn-shell pattern, extended regular expressions, grep patter,
fgrep pattern, perl regular expressions etc.)) instead of the "grep".
Even replacing "#!/usr/bin/ksh -p" with "#!/usr/bin/ksh93" would be huge
win for this script because things like "cat" would more or less end-up
as unimportant NO-OP (which isn't 100% correct, however I'd worrying
more about the heavywheight receiving end of the pipe than the rather
unimportant pass-through "cat" at the beginning).
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)