toralf wrote:
Hello,
I've to script sth under Windows and would like to set the DB2
environment w/o that batch file to stay at my bash prompt. How can I do
that ?
I think the safest way to do that is not to do it. Instead, run db2cw from
a cmd prompt, and then from there, run bash. That way, bash will merely
inherit the environment instead of having to figure it out yourself. Also,
if db2cw.bat is updated in a fix pack or something, your environment will
stay up to date (i.e., the next time you run it, just like everyone else).
Or, if this is all scripting, just write a batch file around your shell
script which merely calls db2cw first, and then runs bash with your current
script. This is what, as an example, C programs would have to do if they
can't just set the environment themselves: they rely on the user having set
up the DB2 environment first.