- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Difference between export and set command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 02:57 AM
тАО02-19-2007 02:57 AM
What is the exact differece between export and set command on any unix machines.....
How about using env?... what diff will this make....Please clarify
Advance Thanks,
Prabu.S
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 03:05 AM
тАО02-19-2007 03:05 AM
Re: Difference between export and set command
export takes a variable that has been set:
DISPLAY=localhost:0.0
and makes it available to sessions outside your current one.
export DISPLAY=localhost:0.0
Will permit another process, the X server iin this case to operate and work with the display.
The set command merely puts a value in a variable and does not make it available to other processes. Its the same as my DISPLAY statement above without the export command.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 03:07 AM
тАО02-19-2007 03:07 AM
Re: Difference between export and set command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 03:13 AM
тАО02-19-2007 03:13 AM
Re: Difference between export and set command
For example "set -a" if used at the start of a script exports all subsequently defined variables. Similarly "set -x" is useful for debugging shell scripts etc. etc. man sh-posix(1) for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 03:19 AM
тАО02-19-2007 03:19 AM
Re: Difference between export and set command
I really hate questions of this kind because they are so all inclusive. --- and probably impossible to answer in a finite time.
Difference 1: export has 6 letters; set has 3.
Difference 2: The letters themselves are different.
Moreover ( and more to the point), the question needs a context. For example, "set" and "export" could be database related although I am all but positive your mean in a shell context. Ok, which shell?
If you want exact answers then learn to ask better (if not exact) questions.
Doing a "man sh-posix" or a "man ksh" would be a step in the right direction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 05:10 AM
тАО02-19-2007 05:10 AM
Solution> If I type set, I see a lot of variables. If I assign two variables like this:
>
> ABC=1
> export DEF=2
>
> then set shows both values. So what does export do?
Is that fairly accurate? The answer is that set (with no parameters) shows all local and exported variables. The env command shows *only* exported variables. In the above example, ABC is not exported and does not show up in env and subprocesses will never see it. But DEF is in env and therefore will be seen by any subprocesses.
When you are writing scripts, you need to decide if a variable is needed by another process. Any subprocess that you start will only see the results of the env command.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 03:38 PM
тАО02-19-2007 03:38 PM
Re: Difference between export and set command
Thanks a lot for the replies, I would also dig more and post my summary soon.
Coming back to replies,
To Bill Hassell,
Yes, you have answered almost, thanks a lot...
To Clay Stephenson,
I never expected such a harsh reply.... I know this is trivial, but wanted to know more about it, that's why I posted...
I have posted this in sys adm section, so it didnot mean a db question, also I never told so...
I would be happier if there is a option of assigning points in negative...
Also, if you r not interested in questions, for god sake don't reply..... I hope the moderator is watching this thread atleast...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 04:05 PM
тАО02-19-2007 04:05 PM
Re: Difference between export and set command
For example, if you had inquired as to the difference between set and export under the POSIX shell under HP-UX, that would have been a sufficiently narrowly confined question to answer in a reasonable amount of time.
In many areas of science (and computers), it's at least as important to know how to ask questions (of others or of Nature) as it is to know how to answer them. Take a hard look at your original question and I think you will understand the point I was trying to make and I consider that far more important than the answer --- which as I pointed out the man pages will provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2007 04:36 PM
тАО02-19-2007 04:36 PM
Re: Difference between export and set command
I was able to get some valid points b4 posting here, but wanting to get different options here, so I would help me and everyone, this is what I think forums means....
I really don't you to declare that I have not referred man pages or without ground work, just posting questions here.....Simply rubbish....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-26-2007 12:31 AM
тАО03-26-2007 12:31 AM