If $foo exists and is not null, return $foo. If it doesn't exist or is null, return bar. export foo... If $foo exists and is not null, return $foo. If it doesn't exist or is null, set $foo to bar and ret... } If $foo exists and is not null, return bar. If it doesn't exist, or is null, return a null. export... $foo exists and is not null, return its value. If it doesn't exist or is null, print the error message
ular instance, both "-ne" and "!=" work.
echo
exit 0</code>
=== Example 7-6. Testing whether a stri... [ ... ]
# If a string has not been initialized, it has no defined value.
# This state is called "nul... ng result.
# Shows $string1 as not null, although it was not initialized.
echo
# Let's try it again.
if [ -n "$string1" ] # This time, $string1 is quo