Unix return value "-bash" -
i not know return value means
grep abc letters echo $? 0 echo $0
gives "-bash" "-bash" return value mean
the question should moved https://unix.stackexchange.com/.
but anyway, $0
value of variable holds name of application that's executing command. it's argv[0]
in c.
example:
cdshines@v3700:~|⇒ echo $0 # i'm in zsh /bin/zsh cdshines@v3700:~|⇒ bash # let's run bash: cdshines@v3700:~$ echo $0 bash cdshines@v3700:~$ sh # need go deeper: $ echo $0 sh $ zsh # deeper! cdshines@v3700:~|⇒ echo $0 zsh cdshines@v3700:~|⇒ # hit ctrl-d (pop 1 level): $ echo $0 sh $ # pop again: cdshines@v3700:~$ echo $0 bash cdshines@v3700:~$ exit # again: cdshines@v3700:~|⇒ echo $0 /bin/zsh # we're @ starting point
Comments
Post a Comment