I have two scenarios. One of them is called sqlscript.sql, and the other - script.sh. I have all the necessary queries written in my sql script. This is just a bunch of update statements. For instance:
UPDATE xxDev.SYS_PARAMS SET val = 'serverName' WHERE lower(name) = 'enginebaseurl';
I am running a .sql script in a .sh script. When the .sh script starts, I want it to ask the user for the server name and enter this user input and replace it serverNamein the sql statements.
I am new to bash scripts and this website, so I hope that I have the point of asking this question. I use PuTTY, if that matters at all.
Thanks for the advanced.
source
share