I have the following line of code in a bash script.
echo password | sudo -S su -l otrouser -c 'mysql -e "GRANT ALL ON wordpress.* to 'usuario'@'localhost' IDENTIFIED BY 'userpass';"'
I want to execute the mysql
statement as another user.
If I execute the statement directly in the mysql console, it executes it without problems.
I do not know if it can be a problem of single quotes, double quotes or too many nested commands.
Thank you .-