I want to execute a .sql file in a bash file, but I need to pass parameters to .sql from a bash file. I think this is a simple solution, but I cannot understand.
This is what I have so far:
. SQL file
SET @columnValue = &1; UPDATE tblTest SET Description = @columnValue;
Bash file
#!/bin/bash columnValue=$1 mysql -uroot -ppassword testDB < SQLscript.sql $columnValue
Shell
sh myBashFile.sh "testColumnValue"
Can someone tell me what I am doing wrong?
source share