Debian Codegraph @

hello.sh

raw symbols SCIP
1 #!/bin/bash
2 # hello.sh: Saying "hello" or "goodbye"
3 #+ depending on how script is invoked.
4
5 # Make a link in current working directory ($PWD) to this script:
6 # ln -s hello.sh goodbye
7 # Now, try invoking this script both ways:
8 # ./hello.sh
9 # ./goodbye
10
11
12 HELLO_CALL=65
13 GOODBYE_CALL=66
14
15 if [ $0 = "./goodbye" ]
16 then
17 echo "Good-bye!"
18 # Some other goodbye-type commands, as appropriate.
19 exit $GOODBYE_CALL
20 fi
21
22 echo "Hello!"
23 # Some other hello-type commands, as appropriate.
24 exit $HELLO_CALL