LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-29-2004, 02:02 AM   #1
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Rep: Reputation: 30
When to use the set and when to use export command?


Under what situation do I need to use the set command, the export command or both together?

Thanks!
 
Old 03-29-2004, 03:44 AM   #2
profjohn
Member
 
Registered: Mar 2004
Location: Jinhua, People's Republic of China
Distribution: MDK, RH, KNPX
Posts: 161

Rep: Reputation: 30
In a terminal enter:

man set

and press return. Read all about it, then enter:

man export

and press return.

If you have problem navigating man pages, enter:

man man

and press return.

I think this will answer most of your questions, but answer back if it does not.
 
Old 03-29-2004, 03:48 AM   #3
|2ainman
Member
 
Registered: Mar 2004
Distribution: Slackware current, DSL 0.9.2
Posts: 133

Rep: Reputation: 15
The set command is used to see or modify environmental variables. These variables control the behavior of the shell. You would use set to change one of these variables. Export is used in scripting to make a variable visible to other processes that are running. If you export a variable that is the same name as one of the variables that the shell uses, then you have in effect changed the value of that variable. Hope that helps.
 
Old 03-29-2004, 04:17 AM   #4
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Original Poster
Rep: Reputation: 30
Thanks for the reply

So in effect, set command and export command both allow you to change your environmental variables, but only export command allow the variable to be visible to other running processes?


Quote:
Originally posted by |2ainman
The set command is used to see or modify environmental variables. These variables control the behavior of the shell. You would use set to change one of these variables. Export is used in scripting to make a variable visible to other processes that are running. If you export a variable that is the same name as one of the variables that the shell uses, then you have in effect changed the value of that variable. Hope that helps.
 
Old 03-29-2004, 04:24 AM   #5
|2ainman
Member
 
Registered: Mar 2004
Distribution: Slackware current, DSL 0.9.2
Posts: 133

Rep: Reputation: 15
i think set effects environmental variables, and export makes them environmental (meaning they can be seen by other processes).
 
Old 03-29-2004, 05:01 AM   #6
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Original Poster
Rep: Reputation: 30
So in order to set my proxy server, which is the right serquence?

export HTTP_PROXY=http://proxy.server.com:8080/
set HTTP_PROXY

or

set HTTP_PROXY
export HTTP_PROXY=http://proxy.server.com:8080/

?

Also, do the settings stay after a reboot?

Thanks again !


Quote:
Originally posted by |2ainman
i think set effects environmental variables, and export makes them environmental (meaning they can be seen by other processes).
 
  


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
set/export command? blackzone Linux - Newbie 1 03-05-2005 08:11 PM
set and export using bash script acummings Linux - General 10 01-03-2005 03:22 PM
Permanently Set a Export Setting (LD_LIBRARY_PATH) nistelrooy Linux - General 1 11-25-2004 12:33 PM
what is the difference between export and set ashley75 Linux - General 7 11-04-2003 05:30 PM
Export Command choawk Linux - General 1 06-06-2003 02:26 AM


All times are GMT -5. The time now is 08:46 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration