March 2002
Beginner
504 pages
10h 47m
English
| 1: | What is the difference between the following commands?if [ -e /usr/local/bin/bash ] ; then /usr/local/bin/bash ; fi if [ -x /usr/local/bin/bash ] ; then /usr/local/bin/bash ; fi |
| A1: | The difference is that the first command will try to run the command without checking if it is executable. Thus if the file exists but is not executable, the command will fail. The second command takes this into account and attempts to run the command only if it is executable. |
| 2: | Given the following variable declarations,HOME=/home/ranga BINDIR=/home/ranga/bin what is the output of the following if statement?
if [ $HOME/bin = $BINDIR ] ; then
echo "Your binaries are stored in your home directory."
fi
|
| A2: | The output is
Your binaries are stored in your ... |
Read now
Unlock full access