Re: Lisp/Unix impedance [a programming challenge]



Kirk Job Sluder <kirk@xxxxxxxxxxxxx> writes:

>On the other hand, this comes at a pretty hefty price. When you do
>something like this...
>
>for f in *; do
> grep <something> $f | sed -e <something> | sed -e <something>
>done
>
>...the process overhead stacks up pretty darn quick, and you might be
>better off re-writing the whole thing in pure lisp/perl/python anyway

Of course you can replace the above pipeline with a single sed
invocation but I get your point. I don't think it's that much
overhead, btw. Unless you have many millions of files. But then I'd
think that most of the time would be spend in grep (or sed) scanning
the input anyways, unless of course the files are very small. For
small file sets, the effort of hoisting the Lisp runtime is probably
significant (grep and sed load very fast, especially when they're
cached.) Never underestimate simple shell scripts.

mkb.
.