- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Having problem with ksh, environment variable not ...
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
10-16-2003 09:22 AM
10-16-2003 09:22 AM
Having problem with ksh, environment variable not set
I am trying to set some environment variable. This variables are define in a file as export VBHOME=VHOME/xyz. When I source this file, I get VHOME not set, but if I change the shell to sh, I don't get this issue. Please help
Thanks
Sushil Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 11:08 AM
10-16-2003 11:08 AM
Re: Having problem with ksh, environment variable not set
export VBHOME=$VHOME/xyz
right?
If so, try adding a "set +u" (the opposite of "set -u") to the script before you try to dereference VHOME. ksh is likely treating unset variables as errors.
$ echo $ASDF
$ set -u
$ echo $ASDF
ksh: ASDF: parameter not set
$ set +u
$ echo $ASDF
You can use $- to determine if "u" is set or unset:
$ echo $-
ism
$ set -u
$ echo $-
isum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 11:12 AM
10-16-2003 11:12 AM
Re: Having problem with ksh, environment variable not set
We often find it less cluttering to export the variables directly in the script so as not to source in more than is needed.
Not the answer for your why, but a solution for your problem none the less.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 09:05 PM
10-16-2003 09:05 PM
Re: Having problem with ksh, environment variable not set
you can use ${parameter:-word}
export VBHOME=${VHOME:-""}/xyz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2003 09:12 PM
10-16-2003 09:12 PM
Re: Having problem with ksh, environment variable not set
How are you sourcing this file because I can't think of any circumstances where "export VBHOME=VHOME/xyz" will produce an error. Even if this a typo and it should read $VHOME it still shouldn't produce an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2003 02:12 AM
10-17-2003 02:12 AM
Re: Having problem with ksh, environment variable not set
How you are posting questions using my ID???????? I don't think I know you. Did you hack into my account on ITRC?
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2003 04:27 AM
10-17-2003 04:27 AM
Re: Having problem with ksh, environment variable not set
VBHOME=${VHOME:-/usr/local}/xyz
If $VHOME is not set then VBHOME will be set to:
/usr/local/xyz