In my script, I try to set a variable with a usage message, like this:
usageMsg="Usage: myScript.sh [nested|silent]"
When I echo out that variable, I get this:
Usage: myScript.sh s
after doing a lot of trial and error, it seems like the "s" inside the brackets has some special meaning. If I replace the s characters with anything else, it works fine.
eg:
usageMsg="Usage: myScript.sh [nedted|filent]"
when that is echo'ed out I get:
Usage: myScript.sh [nedted|filent]
Or boiled down further:
pshirl:# variable="[a]"
pshirl:# echo $variable
[a]
pshirl:# variable=""
pshirl:# echo $variable
s
pshirl:# variable="[aaaaa]"
pshirl:# echo $variable
[aaaaa]
pshirl:# variable="[sssss]"
pshirl:# echo $variable
s
What gives ? What is so special about the "s" ?