LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 01-27-2011, 07:40 AM   #1
jdlandry_ohio
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


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
 
Old 01-27-2011, 08:02 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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 08:06 AM.
 
Old 01-27-2011, 08:41 AM   #3
jdlandry_ohio
LQ Newbie
 
Registered: Aug 2005
Posts: 2

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


Reply


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 06:35 AM
Shell script - stdout & stderr to terminal and file jantman Linux - Software 1 12-07-2006 04:34 PM
Kde: open konsole window when running script sunpascal Linux - Software 5 04-14-2006 09:43 PM
Simple shell script to open up terminal and ssh to another machine deadseasquirrel Programming 1 02-02-2006 05:25 AM
bash shell env var script ejbest Linux - Newbie 4 09-29-2004 10:23 AM


All times are GMT -5. The time now is 04:03 PM.

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