shell scripting Flashcards
1
Q
$x
A
accessing a variable
2
Q
‘$x’ vs. “$x”
A
string literal vs. variable
3
Q
special characters:
A
” , $, `, “, *
4
Q
read
A
reads input; by default, splits the input into words, considering <space>, <tab>, and <newline> characters as word delimiters</newline></tab></space>
5
Q
read -s
A
suppress the printout of the input
6
Q
read -p
A
specify prompt message
7
Q
read -t N
A
timeout after N seconds
8
Q
read -n N
A
read exactly N characters
9
Q
:-
A
replace a empty variable with a default value
10
Q
:=
A
assign default values to empty variables
11
Q
-n <string></string>
A
length non-zero
12
Q
-z <string></string>
A
length zero
13
Q
<string>
</string>
A
string non-zero
14
Q
-eq
A
is equal
15
Q
-neq
A
not equal