OK.  So, the various other [nested] expansions happen first.
That explains the phenomenon.  I still don't quite understand
why this is desirable (other than possibly ease of programming),
but that's fine, too.  Why do all the extra work, when the results
aren't going to be used?  The answer must be "for the side effects".
I guess I have to either get used to that.  I may learn to love it.  (-;

Thanks everyone for pointing out the miss!

--@;


PS

On Thu, Apr 18, 2013 at 12:02:55PM -0500, Dan Douglas wrote:
> 
> 10 factorial (bash/ksh93/zsh):
> 
>      $ f=n=n?n--*f:1 let n=10 f
bash: let: n=n?n--*f:1: expression recursion level exceeded (error token is 
"n?n--*f:1")

>      $ echo "$n"
0

$ bash --version
GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


Reply via email to