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

Portably checking for shell level



    Hi all :)

    I have a shell script that cannot be sourced, because it must be
run in a clean environment. Under zsh I achieve this using 'emulate
-L zsh', or just by checking '$SHLVL' if the script won't run just by
defaulting the ZSH options. The problem is: how to do this portably?
SUS doesn't even define a 'source' builtin, neither a $SHLVL shell
parameter, so I'm completely lost...

    I know that this question is a bit offtopic here: if this annoys
anyone, please tell me where could I send this kind of questions.
Otherwise I prefer to ask here because here is where the shell
experts are. And, in any case, sorry if I'm bothering anyone.

    Thanks in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/



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