LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Check that script is being sourced (https://www.linuxquestions.org/questions/linux-software-2/check-that-script-is-being-sourced-497909/)

trek413 11-02-2006 10:24 AM

Check that script is being sourced
 
I have a script that must be sourced. Is there some way
to check that the script is being executed in this fashion
and throw an error if not?

unSpawn 11-02-2006 11:38 AM

assimilate() { source "$1" 2>/dev/null || echo "in ${FUNCNAME}(): \"$1\" not ${FUNCNAME}d "; }
]$ assimilate microsoft
in assimilate(): "microsoft" not assimilated


All times are GMT -5. The time now is 05:26 AM.