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 |
| 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
|
| 3: | Write a test command that can be used to test if /usr/bin is a directory or a symbolic link. |
| 4: | Given the following if statement, write an equivalent case statement:
if [ "$ANS" = "Yes" -o "$ANS" = "yes" -o "$ANS" = "y" -o "$ANS" = "Y" ] ;
then
ANS="y"
else
ANS="n"
fi
|
Read now
Unlock full access