sion of the form ${param:offset[:length} is used, an `offset' that evaluates to a number less than zero counts back from the end of the expanded value of $param.
When a negative `offset' be... that ${param:-word} already has a well-defined meaning: expand to word if the expanded value of param is unset or null, and $param otherwise.
To use negative offsets tha... s
else
mv $i ${i%l}
fi
done
Substitution
Another kind of variable mangling you might want to employ is substitution. There are four substi... asename(1). basename takes a pathname as argument and returns the filename only; it is meant to be used with the shell's command substitution mechanism (see below). basename is
ons ===
<code>
#!/bin/bash
a=4
b=5
# Here "a" and "b" can be treated either as integers or strings.
# Ther... ASCII 52 != ASCII 53
fi
# In this particular instance, both "-ne" and "!=" work.
echo
exit 0</code>
=== Example 7-6... strings and unquoted strings,
#+ but not strings and sealing wax, not to mention cabbages and kings . . .
# Using if [ ... ]
# If a string... ode>[[ condition1 && condition2 ]]</code>
The -o and -a operators work with the test command or occur within single test brackets.
<code>
if