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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -