Which of the following statements can be used to compare two strings? Select all answers that apply.
A. if [ $STR1 == $STR2 ] ; then echo match found ; fi
B. if [ $STR1 -eq $STR2 ] ; then echo match found ; fi
C. if [[ $STR1 = $STR2 ]] ; then echo match found ; fi
D. All of the above
查看答案
Which are possible correct commands to add two numbers? Select all answers that apply.
A. expr 2 + 3
B. echo expr 2 + 3
C. let x=( 1 + 2 ); echo $x
D. echo (expr(2 + 3))
What commands are used to write the output of the free command to /tmp/free.out? Select all answers that apply.
A. free >> /tmp/free.out
B. free
C. free > /tmp/free.out
D. free
Which of the following parameters contains the name of the script being executed?
A. $n
B. var
C. $0
D. $*
Which of the following supplies the correct syntax to declare the function named showpath?
A. showpath [echo $PATH]
B. showpath {echo $PATH}
C. showpath () {echo $PATH}
D. showpath (echo PATH)