On Sat, 19 Mar 2011 09:44:57 -0700
Devin Teske <[email protected]> wrote:


> At least two variations to the rule that { ... } is a block of
> commands executed in the current shell are:
> 
> 1. When the block appears as a function 

Is that correct? I'd assumed that functions do execute in the current
shell since you can alter variables from a function, whilst you can't
from a "()".

e.g. 
--------------------------------------------------------------------
$ cat /tmp/foo
#!/bin/sh

f (){
  x=2
}

x=1
f
echo $x
( x=3 )
echo $x

--------------------------------------------------------------------

$ /tmp/foo
2
2



_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to