re's a handy mnemonic device: # matches the front because number signs precede numbers; % matches the rear because percent signs follow numbers.
The expression ${DI... ould have the incorrect value dave/pete/fred/bob, because the shortest instance of "anything followed by a ... . basename is less efficient than ${variable##/*} because it runs in its own separate process rather than w
.
# Still, it is better to quote it ("$string1"), because . . .
string1="a = b"
if [ $string1 ] # ... False condition. So, why "true" output?
# Is it because both condition clauses within brackets evaluate?