From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7862 invoked by alias); 17 Dec 2014 16:17:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19552 Received: (qmail 328 invoked from network); 17 Dec 2014 16:16:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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== X-Received: by 10.224.13.145 with SMTP id c17mr77333867qaa.96.1418833012737; Wed, 17 Dec 2014 08:16:52 -0800 (PST) MIME-Version: 1.0 From: TJ Luoma Date: Wed, 17 Dec 2014 11:16:12 -0500 Message-ID: Subject: using variables from .zshenv in shell scripts To: Zsh-Users List Content-Type: text/plain; charset=UTF-8 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???)