LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need shell script to source an env file and open a kde konsole terminal (http://www.linuxquestions.org/questions/linux-newbie-8/need-shell-script-to-source-an-env-file-and-open-a-kde-konsole-terminal-859011/)

jdlandry_ohio 01-27-2011 07:40 AM

Need shell script to source an env file and open a kde konsole terminal
 
Hello

I am trying to write a .sh script that will source a file containing evnironment variables and then open a konsole terminal session that will have those settings.

Can anyone help or point me in the direction on how to do that?

Thanks

jschiwal 01-27-2011 08:02 AM

The script could set the variables you want, export them, and then launch the terminal. Exported variables will be inherited by a subshell.

You could also set the variables on the same line where you launch the konsole program.
var1=value1 var2=value2 konsole &

If the variables already exist and where previously exported, then changing the values will be inherited by a subsequent subshell. If the variables were created in the same script and not exported, they won't exist in the subshell.

Be sure to experiment, and learn this for yourself. Good Luck.

jdlandry_ohio 01-27-2011 08:41 AM

Thanks for the reply, but I figured it out.


All times are GMT -5. The time now is 07:42 AM.