bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Logical operators in arithmetic evaluation: documentation vs impleme


From: andras
Subject: Re: Logical operators in arithmetic evaluation: documentation vs implementation
Date: Thu, 18 Apr 2013 22:08:43 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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

[Prev in Thread] Current Thread [Next in Thread]