zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: ZSH Workers Mailing List <zsh-workers@sunsite.dk>
Subject: Re: export -f problem
Date: Fri, 2 Nov 2001 16:23:19 -0800	[thread overview]
Message-ID: <011102162319.ZM4699@candle.brasslantern.com> (raw)
In-Reply-To: <3BE2ED8E.6080406@mow.siemens.ru>

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.


      reply	other threads:[~2001-11-03  0:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-02 19:01 Borsenkow Andrej
2001-11-03  0:23 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=011102162319.ZM4699@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).