Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Detect if a script is being sourced vs executed



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



Messages sorted by: Reverse Date, Date, Thread, Author