Class 25 Flashcards

1
Q

In a case statement, what determines which block of code is executed?

A

the value of the variable between case and in

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you mark the end of a code block in a case statement?

A

;;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What signals the end of a pattern in a case statement?

A

)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What meta-characters can you use in a case statement pattern?

A

all of them: ?, * and [ ]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What pattern would you use in a case statement if you wanted to match 11, 12 or 13?

A

11|12|13

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What will you see on the screen if you ran a script that uses the select statement?

A

a menu of numbers followed by values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens to the value chosen by the user when responding to a select statement?

A

the value is assigned to the select variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What function does the PS3 keyword shell variable serve in a select statement?

A

it contains the text used in the menu prompt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you mark the beginning of a here document in a shell script?

A

&laquo_space;followed immediately by a string with no spaces between them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you mark the end of a here document?

A

with the same string that starts the here document on a line by itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly