I'm trying to write a bash script to automate some MySQL backups and I'm using mysqlshow to test whether I've got a successful connection. Its working, but the problem is that some of my MySQL passwords contain spaces and the scripts are choking on passwords that contain spaces.
If I define a variable
mysqlshow="mysqlshow -u $user -p'$password' database_name"
Then try run that command with
result=$($mysqlshow)
I get an error from mysqlshow saying Too many arguments
. This is being caused by spaces in $password
as it works for passwords without spaces.