Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: export -f problem
- X-seq: zsh-workers 16212
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH Workers Mailing List <zsh-workers@xxxxxxxxxx>
- Subject: Re: export -f problem
- Date: Fri, 2 Nov 2001 16:23:19 -0800
- In-reply-to: <3BE2ED8E.6080406@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <3BE2ED8E.6080406@xxxxxxxxxxxxxx>
Egad. Apparently the rule is, if the first four characters of the value
of an environment variable are `() {', it gets defined as a function upon
import. Look:
schaefer[504] export foo='(){echo hi there;}'
schaefer[505] bash2
bash2-2.03$ foo
bash2: foo: command not found
bash2-2.03$
schaefer[506] export foo='() {echo hi there;}'
schaefer[507] bash2
bash2: foo: line 1: syntax error near unexpected token `{echo'
bash2: foo: line 1: `foo () {echo hi there;}'
bash2: error importing function definition for `foo'
bash2-2.03$
schaefer[508] export foo='() { echo hi there; }'
schaefer[509] bash2
bash2-2.03$ foo
hi there
bash2-2.03$
I think this is rather horrible; but, if we actually implement something
like this, we have to make sure that we do not allow `preexec', `precmd',
`periodic', `TRAPxxx', etc. to be imported.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author