zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: trap ERR
Date: Tue, 21 Feb 2017 20:21:33 -0800	[thread overview]
Message-ID: <170221202133.ZM15856@torch.brasslantern.com> (raw)
In-Reply-To: <a582f766-6e37-bc75-4920-08de0713d1f4@eastlink.ca>

On Feb 21, 11:57am, Ray Andrews wrote:
}
} I don't execute scripts much because they are 'naked', but if I put
} the whole thing in .zshenv are you saying that every script will have
} everything available?

If the script starts with "#! /bin/zsh -f" (for example), then no, the
-f option turns off .zshenv too; but any scripts that don't use -f will
read ~/.zshenv, whereas only interactive or login shells read the
others (it's rare but possible for a shell to be a login shell yet not
be interactive).

Generally speaking there are going to be some things that you don't
want to have happen in non-interactive shells, so I wouldn't suggest
blindly "mv ~/.zshrc ~/.zshenv" -- and you should be cautious about
e.g. "ssh somehost somecommand" behaving differently because somehost
has stuff in .zshenv.


  reply	other threads:[~2017-02-22  4:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  6:08 Ray Andrews
2017-02-21 15:52 ` Ray Andrews
2017-02-21 16:41   ` Peter Stephenson
2017-02-21 16:56     ` Ray Andrews
2017-02-21 17:30       ` Bart Schaefer
2017-02-21 19:57         ` Ray Andrews
2017-02-22  4:21           ` Bart Schaefer [this message]
2017-02-22  4:39             ` Ray Andrews

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=170221202133.ZM15856@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).