2008/12/5 guy keren <[EMAIL PROTECTED]>:
> this is a great way to write "write-only" code. often-times, the simple
> solution, even if it is uglier, is the one that'll be easier to maintain
> later on.

I think the external-script solution is uglier because it's yet
another file to keep track of in a heap of scripts and config files.

>
> and regarding the function - this is completely different from using a
> variable - because of the way the shell performs its expansion work. the
> main problem is that the shell works in a non-recursive expansion order
> (i.e. it knows how to expand 7 or 8 things, but it always expands them in
> the same order). this is most likely why an extra eval helped - it causes
> the shell to expand everything twice. unfortunately, those evals sometimes
> add other side effects that break the expression, and they cause code to be
> un-maintainable.

Can you give a full example of how would you rewrite the sample code
to use a shell function instead of eval?

Code maintainability is very important to me.

Thanks,

--Amos

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to