- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Setting Unix User Envirment Variables
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
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
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
03-31-2008 01:26 AM
03-31-2008 01:26 AM
I need to setup following user enviroemnt variable.
SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
Do i use set command
or Export command
Whats is the difference between SET and Export?
Also what would be correct command syntax
set SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
export SHLIB_PATH /usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
Thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 01:38 AM
03-31-2008 01:38 AM
Re: Setting Unix User Envirment Variables
SET is used in the Windows environment to set Environment variables whereas EXPORT is used in the Unix Environment.
For more information, please see "man set" and "man export"
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 01:40 AM
03-31-2008 01:40 AM
Re: Setting Unix User Envirment Variables
set makes the variable available for this command session.
export makes it available for child processes as well.
I generally set and export the variable to make sure its available, though there are exceptions, depending on the application to be run.
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
03-31-2008 01:41 AM
03-31-2008 01:41 AM
Re: Setting Unix User Envirment Variables
Both your answers are correct!
Here is the difference and why you need
to use one or the other:
It all depends on the Shell you use.
For Shells like Ksh, Bash, Posix Shells,
and classical Sh, you would use:
export SHLIB_PATH /usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
For Cshell, you would use:
setenv SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 01:44 AM
03-31-2008 01:44 AM
Re: Setting Unix User Envirment Variables
$ set SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
$ echo $SHLIB_PATH
sh: SHLIB_PATH: Parameter not set.
$ export SHLIB_PATH /usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
sh: /usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib: This is not an identifier.
$ export SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
$ echo $SHLIB_PATH
/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
$
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 01:49 AM
03-31-2008 01:49 AM
Re: Setting Unix User Envirment Variables
SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
export SHLIB_PATH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 03:27 AM
03-31-2008 03:27 AM
SolutionAs mentioned by Dusan, it depends on which shell you use. If you use a real shell you use export. If you use the scummy csh, you use setenv.
The set command in a real shell only works on arrays. For the scummy csh, it doesn't export the variable.
>yogeeraj: For more information, please see "man set" and "man export"
You'll need to look at ksh(1), posix-sh(1) or csh(1) for the individual commands.
>Dusan: For shells like ksh, bash, Posix Shells
>export SHLIB_PATH path1:path2
>For cshell, you would use:
>setenv SHLIB_PATH=path1:path2
The syntax is backwards, export needs the "=".
>ahsan: if you need to setup environment variable permanently set it to the .profile
Unless you use this user to only run a particular set of apps that only need this SHLIB_PATH, I would only export SHLIB_PATH/LD_LIBRARY_PATH in the script that invokes each application.
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 11:39 PM
03-31-2008 11:39 PM
Re: Setting Unix User Envirment Variables
Information provided has been very usefull.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2008 01:36 AM
04-01-2008 01:36 AM
Re: Setting Unix User Envirment Variables
Thanks to Dennis for the correction.
My fast typing again.
I am actually the fastest two-finger
typing person on the east coast of
Australia :) Not always the most
precise one though :)
The correct syntax (as we all know):
For BASH, Ksh, Posix Shells:
export SHLIB_PATH=/usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
For Cshell:
setenv SHLIB_PATH /usr/sap/D06/SYS/exe/run:/oracle/D06/920_64/lib
Sadly, even after 23 years in Unix,
I cannot use all fingers when typing...
VK2COT