Ken Schneider wrote:
On Mon, 2005-04-25 at 23:49 +1000, Mike Dewhirst wrote:
Ken Schneider wrote: Ken
I wasn't very clear with my original question so please accept my apology - but that is exactly what I want to do. The bash script sets the user and password vars then calls a series of sql scripts to create a database and make tables, populate some and do other stuff. Everything you do with the database needs those two vars.
The sql scripts have to be versioned during development because they will gain more and more detail until they can be used in production. It would be poor practice to store userid and password in a source control management system so I want to just call an environment var from each sql script.
Thanks again
Mike
The other thing you can do is have the script ask for the info, that way you don't need to store them inside of the script. It has been a long time since I wrote any scripts but it can be done. Perhaps someone else on the list can help with that part.
Now that would be nice. I could safely put the bash script under version control too :) Mike