Bash Scripting Flashcards

1
Q

is equal to

A

-eq

if [ “$a” -eq “$b” ]

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

is not equal to

A

-ne

if [ “$a” -ne “$b” ]

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

is greater than

A

-gt

if [ “$a” -gt “$b” ]

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

is greater than or equal to

A

-ge

if [ “$a” -ge “$b” ]

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

is less than

A

if-lt

[ “$a” -lt “$b” ]

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

is less than or equal to

A

-le

if [ “$a” -le “$b” ]

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

is less than

A

<

(within double parentheses)

((“$a” < “$b”))

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

is less than or equal to

A

<=

(within double parentheses)

((“$a” <= “$b”))

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

is greater than

A

>

(within double parentheses)

((“$a” > “$b”))

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

is greater than or equal to

A

> =

(within double parentheses)

((“$a” >= “$b”))

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

is equal to

A

= (or ==)

if [ “$a” = “$b” ]

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

is not equal to

A

!=

if [ “$a” != “$b” ]

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

string is null, that is, has zero length

A

-z

string is null, that is, has zero length

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

string is not null

A

-n

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

logical ‘and’

A

-a

exp1 -a exp2
returns true if both exp1 and exp2 are true

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

logical ‘or’

A

-o

exp1 -o exp2
returns true if either exp1 or exp2 is true