Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Which of the following results in error? expr 3*9 expr 1+2 expr 5-4 expr 4/5

ID: 3901871 • Letter: 1

Question

1. Which of the following results in error?

expr 3*9

expr 1+2

expr 5-4

expr 4/5

2. Which of the following is not a filter program?

sort

cat

grep

date

3. case statement ends with

end

end case

fi

esac

4. For logical OR operation, ______option is used

–c

–d

-o

–a

5. Choose incorrect statement.

Shell script can accept arguments

Shell script are compiled

Shell scripts are interpreted

Shell supports programming

6. ________pathname uses the current directory as point of reference for the file

Relative

Absolute

Root

None of these

7. The shell prompt when further input is needed, by default it is_______

>

&

$

#

8. When you execute a script called test at $ prompt as $test hi hello, then test will be stored in ____positional parameter.

$#

$*

$0

$1

9. Use of in removing meaning of any meta character placed after it is known as __________

Escaping

Treating

Editing

Debugging

10. Any command surrounded by backquote is executed by shell and its output is inserted in the place it was founded. This is known as

________________.

Command replacement

Parsing

Command substitution

Command execution

Explanation / Answer

1. expr 3 * 9

Explanation : When we echo `expr 3 * 9` it will give syntax error, since symbol * is a special character in shell scripting. It is used as a wild card.

2. date

Explanation : A filter is a program that takes data from the standard input and writes its main result to its standard output. But data command doesn't take its input from standard input.

3. esac

4. -o

5. Shell script are compiled`

Explanation : The shell interprets scripts one command at a time, and figures out every time how to execute each command. So it is interpreted not compiled

6. Relative

7. >

8. $0

Explanation : In shell script there are some positional parameters. $0 stores the name of the program called. $# stores the number of parameters passed to the program and $* stores all the parameters.

9. Escaping

Explanation : In shell script, some characters has special meaning. To use them as normal characters we have to escape those characters using (back slash) character.

10. Command substitution