If Then Comparisons Flashcards
1
Q
-eq
A
equal to (for numbers)
2
Q
[[ STRING == STRING ]]
A
equal to (for strings)
3
Q
-ne
A
not equal to (for numbers)
4
Q
[[ STRING != STRING ]]
A
not equal to (for strings)
5
Q
-lt
A
less than (for numbers)
6
Q
-le
A
less than or equal to (for numbers)
7
Q
-gt
A
greater than (for numbers)
8
Q
-ge
A
greater then or equal to (for numbers)
9
Q
Write an
if statement
include the additional syntax options.
A
if commands; then commands [elif commands; then commands...] [else commands] fi
10
Q
Special variables:
$?
A
Exit status of
last task:
0-255
11
Q
Special variables:
$!
A
PID of last background task
12
Q
Special variables:
$$
A
PID of shell
13
Q
Special variables:
$0
A
Filename of the shell script
14
Q
Special variables:
$_
A
Last argument of the previous command
15
Q
Special variables:
${PIPESTATUS[n]}
A
return value of
piped commands
(array)