Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-27-2011, 08:40 AM   #1
LQ Newbie
Registered: Aug 2005
Posts: 2

Rep: Reputation: 0
Question Need shell script to source an env file and open a kde konsole terminal


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?

Old 01-27-2011, 09:02 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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.

Last edited by jschiwal; 01-27-2011 at 09:06 AM.
Old 01-27-2011, 09:41 AM   #3
LQ Newbie
Registered: Aug 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply, but I figured it out.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't source file by shell script in Ubuntu 10.04 dhanushkag Linux - Newbie 4 08-08-2010 07:35 AM
Shell script - stdout & stderr to terminal and file jantman Linux - Software 1 12-07-2006 05:34 PM
Kde: open konsole window when running script sunpascal Linux - Software 5 04-14-2006 10:43 PM
Simple shell script to open up terminal and ssh to another machine deadseasquirrel Programming 1 02-02-2006 06:25 AM
bash shell env var script ejbest Linux - Newbie 4 09-29-2004 11:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration