Shell Script for Setting Env Variables

Hello All.

Good Afternoon.

I need one small help regarding setting of env variables for a particular host by getting it from the DB.

For ex :

  1. I am using LOCALHOST.
  2. When I run a ./hostset.sh it should pick up the Oracle home details from associated DB and set it.

Please let me know is it a possible one. I am new this UNIX and I went through some of the links but not quite understanding the concept.

Thank you all for your help in advance.

Regards,
Pavan

Hi, try sourcing the script.

. ./hostset.sh

Notice the first dot..

That way variables are changed in your current environment. If you execute the script, then it only affects the separate environment that that script runs in.