Re: Quoted closing brace in variable default expansion

2010-11-13 Thread Jonathan Nieder
Hi Herald, Harald van Dijk wrote: $ ksh -c 'echo ${x:-}}' } $ dash -c 'echo ${x:-}}' dash: 1: Syntax error: Unterminated quoted string $ busybox sh -c 'echo ${x:-}}' sh: syntax error: unterminated quoted string It looks like dash and other ash derivatives stop the expansion

Re: Quoted closing brace in variable default expansion

2010-11-13 Thread Jilles Tjoelker
On Sat, Nov 13, 2010 at 10:41:47AM -0600, Jonathan Nieder wrote: Harald van Dijk wrote: $ ksh -c 'echo ${x:-}}' } $ dash -c 'echo ${x:-}}' dash: 1: Syntax error: Unterminated quoted string $ busybox sh -c 'echo ${x:-}}' sh: syntax error: unterminated quoted string It

Re: static vs. dynamic scoping

2010-11-13 Thread Harald van Dijk
On 09/11/10 23:02, Eric Blake wrote: 2. User aspect: Is anyone aware of a script that intentionally uses the full power of dynamic scoping available through 'local' which would break if scoping switched to static? FWIW, some scripts use local IFS to reset IFS to a sane value, and have the

Re: static vs. dynamic scoping

2010-11-13 Thread ольга крыжановская
How is dynamic scoping in this case 'more useful'? Imagine function a written by author A and function b written by author B, both loaded into an application and each of them working independently, bound together by an api spec. Now function a uses typeset IFS=X to set the field separator to X via

Re: static vs. dynamic scoping

2010-11-13 Thread Harald van Dijk
On 14/11/10 00:54, ольга крыжановская wrote: Now function a uses typeset IFS=X to set the field separator to X via a local variable IFS. If function b now uses read foo1 foo2 foo3 to read a line of a database the concept of dynamic scoping *BITES*. The way I had seen local IFS used is to