Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Exporting variable from within a variable
- X-seq: zsh-users 11094
- From: Andrew Ho <andrewlkho@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Exporting variable from within a variable
- Date: Sun, 24 Dec 2006 20:48:42 +0000
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:subject:message-id:mime-version:content-type:content-disposition:x-crypto:x-gpg-key:x-gpg-fingerprint:user-agent; b=Wo9yUY8TIHCfmsojH5U+4gYjqaZMsblvm1ILSs4q5CATRrYOR4XU9YICeTp6WY2rJui81T+I/XxblzbKGes4HYhKidku+oZyAc3J/jkIAtX/K/lVjAZze8JLOSDXIpFVDL0vwQqwCMGXSC3bnBSXtqhykvi56jjCJ5s9tNLlAg8=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi,
Apologies for the somewhat ambiguous title, but this is quite hard to
succinctly describe. Let's say that I have a variable that contains the
string
export FOO=foo
How do I get that to actually export the variable?
In other words, why does the following script, when run, not set the
environment variable?
% cat ./test
#!/usr/bin/env
FOO="export BAR=bar"
`${FOO}`
% ./test
./test:1: command not found: export BAR=bar
I have a suspicion that this has got something to do with forking and the
environment within which the command is run.
Thanks in advance for any pointers.
Regards,
Andrew Ho
Attachment:
pgpvYyEG8yhda.pgp
Description: PGP signature
Messages sorted by:
Reverse Date,
Date,
Thread,
Author