shell - How do I get the script name being executed in bash? -
so trying create portable bashrc/bash_profile file. have single script symbolically linking .bashrc, .bash_profile, etc. looking @ $0
, switching based on script called. problem shell calls bashrc script of course of study executes bash means $0
me -bash
. $1
farther more not set script name.
so question is, in bash how can name of script beingness executed. not binary executing it, e.g. bash?
i assume giving me -bash
$1
not beingness set because not new process. ideas?
the variable bash_argv
should work, appears script being sourced
$bash_argv
bash shell .bash-profile
No comments:
Post a Comment