Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
using variables from .zshenv in shell scripts
- X-seq: zsh-users 19552
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: using variables from .zshenv in shell scripts
- Date: Wed, 17 Dec 2014 11:16:12 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=VkmfWOGWptBR1ll8hKlq8WCbKe6K4bg8tsiuKs3reT0=; b=Y+ch7Ee6kCCk6284gUf5y9za39TNDxrezghuBwNUv/prQPSB0MBfsOphU2gS2XcVUt BfIuuB7wfwXS66UXfWI7QPXTZUtGTFNfoDlBfWfpdo1efZhqZWqei8CDzdQZKjx6uIZH vbsvnTP+rgJvWmTWhvHqp/ysmdUsYMJC+r7R3K4bPQraZPgvOoHYaDKiLQfdX2nSuBFN xPJSclbjp06JW7l7+WD/v4a1Vx+7wNkm9UEAKfkzbSLy2wYVUWst2v1XvI6JT2ABHEYE YRy+zuAL/Exc5Ic5gHvZcaZZB+BUodiO0I9JsKJId5FInr1YBkby+S+kEZiYQSxaTygY mUUw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Either something weird is happening or I'm missing something really
basic here. (I blame the cold I've had for 2 weeks.)
I have some variables set in ~/.zshenv which I want to use in shell scripts
However, those variables do not seem to be defined when the shell script runs.
For example, if I have this in ~/.zshenv :
export FOO='BAZ'
and then have a shell script:
#!/bin/zsh
echo "Foo is $FOO"
exit 0
shouldn't it output "Foo is BAZ" ?
Instead, I am getting "Foo is "
I thought that shell scripts would read from ~/.zshenv unless the
first line of the shell script included the '-f' such as "#!/bin/zsh
-f"
is there a 'setopt' that I'm missing here?
TjL
(How have I been writing shell scripts for this long and I'm still not
getting something this basic???)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author