Ken Schneider wrote:
On Mon, 2005-04-25 at 15:25 +0200, Anders Johansson wrote:
On Monday 25 April 2005 15:11, Mike Dewhirst wrote:
Ken - thanks for your response. My remaining question is - how do I set them? Googling indicated this should work ...
#!/bin/bash setenv ISC_USER xyz setenv ISC_PASSWORD 999ans
... but it returns setenv command not found. Looking at the man entry it seems setenv is a function to be called from a program. Is there an equivalent which can be called from a script?
setenv is for C-shell. In bash, use 'export'.
export ISC_USER=xyz export ISC_PASSWORD=999ans
But export is not necessary unless you are calling another script that you want to pass variables to, perhaps I am wrong.
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