export $foo="this is a test" echo ${foo%%t*is}
NOTE
While the # and % identifiers may not seem obvious, they have a convenient mnemonic. The # key is on ... on a dossy system
# only handles file extensions, not filenames
for i in *.html; do
if [ -f ${i%l} ]...
else
mv $i ${i%l}
fi
done
Substitution
Another kind of variable mangling you might want to em
> if [ "$a" -eq "$b" ]</code>
----
-ne
is not equal to
<code> if [ "$a" -ne "$b" ]</code>
-... " == "$b" ]</code>
This is a synonym for =.
Note
The == comparison operator behaves differently... al to z* (literal matching).
</code>
----
!=
is not equal to
<code>if [ "$a" != "$b" ]</code>
This ... [[ "$a" < "$b" ]]
if [ "$a" \< "$b" ]
</code>
Note that the "<" needs to be escaped within a [ ] co