I am running a bash script that calls mysql. The password is incorrectly transmitted, I think I need to avoid special characters, for example, a hash or a dollar sign?
#! / bin / bash USER = myuser PASS = "# mypass $" # ... call mysql
Use "..."is already the right thing, but $should be escaped ( \$) if it is not followed by an "invalid" character. However, you also need to always have the variable in quotation marks, as in:
"..."
$
\$
somecommand -p "$PASS"
Try using "\" before the character you are trying to avoid.
#!/bin/bash USER=myuser PASS="#mypass\$" # ... call mysql