oo
one
${foo:+bar} If $foo exists and is not null, return bar. If it doesn't exist, or is null, return a null. export foo="this is a test"
echo ${foo:+bar}
ba... . If no error message is given, print parameter null or not set. Note: In a non-interactive shell, this will abort the current script. In an interactive shell... in, but this time put it in a function file. We will call it functions.sh, the sh meaning shell scripts.
$ pg functions.sh
#!/bin/sh
# fu... ommand format:
. /<path to file>
A subshell will not be created using this method; all functions stay in the current shell.
$ pg direc_check
!/bin/sh
# direc_check
====== Bash Shell Tests ======
Quelle((http://tldp.org/LDP/abs/html/comparison-ops.html))
===== Other... of this comparison operator.
----
-z
string is null, that is, has zero length
<code>
String='' # Zero-length ("null") string variable.
if [ -z "$String" ]
then
echo "\$String is null."
else
echo "\$String is NOT null."