value of the variable as a character string. For example, if filename has the value fred.c, then ${#filena... perators can be used in a variety of ways. A good example would be to give a default value to a variable no... right. The operators, with their functions and an example, are shown in the following table:
Operator Function Example
${foo#t*is} Deletes the shortest possible matc
needs to be escaped within a [ ] construct.
See Example 27-11 for an application of this comparison opera... e unquoted string alone within test brackets (see Example 7-6) normally works, however, this is an unsafe practice. Always quote a tested string.
=== Example 7-5. Arithmetic and string comparisons ===
<code... th "-ne" and "!=" work.
echo
exit 0</code>
=== Example 7-6. Testing whether a string is null ===
<code>