exists and is not null, return its value. If it doesn't exist or is null, print the error message. If no error message is given, print parameter null or not set. No... eginning of the variable's value, delete the shortest part that matches and return the rest.
${variable##pattern}
If the pattern matches... beginning of the variable's value, delete the longest part that matches and return the rest.
${variable%pattern}
If the pattern matches the end of the variable's value, delete the shortest part that matches and return the rest.
${variable%%pattern}
If the pattern matches
to
<code>if [ "$a" -le "$b" ]</code>
----
<
is less than (within double parentheses)
<code>(("$a" < "$b"))</code>
----
//<=//
is less than or equal to (within double parentheses)
<code>(("$a" <= "$b"))</code>
----
>
is greater... >
----
-n
string is not null.
Caution
The -n test requires that the string be quoted within the test brackets. Using an unquoted string with ! -z, or... a string is null ===
<code>
#!/bin/bash
# str-test.sh: Testing null strings and unquoted strings,
#+ but not