zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: Detect if a script is being sourced vs executed
Date: Fri, 12 Sep 2014 16:21:16 -0700	[thread overview]
Message-ID: <140912162116.ZM23683@torch.brasslantern.com> (raw)
In-Reply-To: <20140912200509.6cac2742@pws-pc.ntlworld.com>

On Sep 12,  8:05pm, Peter Stephenson wrote:
}
} I was surprised to find the zsh/parameter modules series of array
} parameters that allow you to trace back the functions, sourced files,
} etc. being executed don't give this information, which is present
} internally.  This adds $functypestack to do this.

Is this in some way NOT redundant with $zsh_eval_context ?  Other than
apparently being in the reverse order?

torch% source =(<<<'() { print $zsh_eval_context }')    
toplevel file shfunc
torch% source =(<<<'() { zmodload zsh/parameter; print $functypestack }')
function source


  reply	other threads:[~2014-09-12 23:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 17:57 Daniel Hahler
2014-09-12 19:05 ` Peter Stephenson
2014-09-12 23:21   ` Bart Schaefer [this message]
2014-09-13  8:01     ` Peter Stephenson
2014-09-16 19:14       ` Peter Stephenson
2014-09-12 20:09 ` Kurtis Rader

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=140912162116.ZM23683@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).