|
| From: | Bernd Eggink |
| Subject: | Re: weird behaviour of ((count++)) when using , , to change to lower case |
| Date: | Sun, 01 Aug 2010 22:59:54 +0200 |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 |
Am 01.08.2010 13:06, schrieb Andrew Benton:
Also good. Now try converting it to lower case with ,,
andy:~$ count=0
andy:~$ echo "${days[${count}],,}, ${days[$((count++))],,},
${days[$((count++))],,}"
monday, tuesday, thursday
What happened to wednesday?
I'd rather expect this to print "monday, monday, tuesday", since you left out the ++ in the first term.
I think the problem is that the ,, operator causes each expression to be evaluated twice. That would explain this behaviour, and it's a bug IMHO.
Regards, Bernd -- Bernd Eggink http://sudrala.de
| [Prev in Thread] | Current Thread | [Next in Thread] |