Re: [9fans] Local variables and rc functions

2008-08-14 Thread Micah Stetson
> Both fixes are in plan9port. Thanks, Russ. Micah

Re: [9fans] Local variables and rc functions

2008-08-14 Thread Russ Cox
> Is this a bug? > > % fn foo { echo $bar } > % bar=baz foo > > % > > I would expect to see baz instead of a blank line. Yes, it is a bug. The fix is: diff -r f7e7b9ab4cfb src/cmd/rc/simple.c --- a/src/cmd/rc/simple.c Sun Jul 20 06:17:17 2008 -0400 +++ b/src/cmd/rc/simple.c Thu Au

Re: [9fans] Local variables and rc functions

2008-08-14 Thread kazumi iwane
i apologize for the noise. i should have tested befoqe posting. rog, thank you for correcting me. On 8/14/08, roger peppe <[EMAIL PROTECTED]> wrote: > On Thu, Aug 14, 2008 at 12:20 PM, kazumi iwane <[EMAIL PROTECTED]> wrote: >> if you want to delay the expansion of an env var until fn invocation,,

Re: [9fans] Local variables and rc functions

2008-08-14 Thread roger peppe
On Thu, Aug 14, 2008 at 12:20 PM, kazumi iwane <[EMAIL PROTECTED]> wrote: > if you want to delay the expansion of an env var until fn invocation,,use > eval. > > % fn foo {eval echo $$bar} sorry, but that's so, so wrong. 1) $$bar gives the value of the variable named by the contents of the vari

Re: [9fans] Local variables and rc functions

2008-08-14 Thread kazumi iwane
if you want to delay the expansion of an env var until fn invocation,,use eval. % fn foo {eval echo $$bar} On 8/14/08, roger peppe <[EMAIL PROTECTED]> wrote: > looks like a bug to me; after all: > > % bar=baz {echo $bar} > baz > % > > i'm somewhat surprised this hasn't been fixed years ago. > > O

Re: [9fans] Local variables and rc functions

2008-08-14 Thread roger peppe
looks like a bug to me; after all: % bar=baz {echo $bar} baz % i'm somewhat surprised this hasn't been fixed years ago. On Wed, Aug 13, 2008 at 10:27 PM, Micah Stetson <[EMAIL PROTECTED]> wrote: > Is this a bug? > > % fn foo { echo $bar } > % bar=baz foo > > % > > I would expect to see baz inste

[9fans] Local variables and rc functions

2008-08-13 Thread Micah Stetson
Is this a bug? % fn foo { echo $bar } % bar=baz foo % I would expect to see baz instead of a blank line. Micah