shell scripting Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

$x

A

accessing a variable

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

‘$x’ vs. “$x”

A

string literal vs. variable

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

special characters:

A

” , $, `, “, *

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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>

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

read -s

A

suppress the printout of the input

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

read -p

A

specify prompt message

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

read -t N

A

timeout after N seconds

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

read -n N

A

read exactly N characters

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

:-

A

replace a empty variable with a default value

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

:=

A

assign default values to empty variables

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

-n <string></string>

A

length non-zero

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

-z <string></string>

A

length zero

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

<string>
</string>

A

string non-zero

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

-eq

A

is equal

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

-neq

A

not equal

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

-gt

A

greater than

17
Q

-ge

A

greater than or even

18
Q

-lt

A

lesser than

19
Q

-le

A

lesser than or even

20
Q

-e

A

exists

21
Q

-f

A

exists and is a regular file

22
Q

-d

A

exists and is in directory

23
Q

-s

A

exists and its size is larger than zero

24
Q

-nt

A

newer than

25
Q

-ot

A

older than

26
Q

continue

A

skips the rest in the current iteration and starts a new iteration

27
Q

$0

A

name of the script

28
Q

$1-$9

A

argument

29
Q

$@

A

all arguments

30
Q

$#

A

number of arguments

31
Q

$?

A

return code of the previous command

32
Q

$$

A

PID of the current command

33
Q

!!

A

entire last command with arguments

34
Q

$_

A

last argument of last command

35
Q
A