- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Clearing all session environment 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
05-10-2002 02:02 PM
05-10-2002 02:02 PM
Clearing all session environment variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2002 02:15 PM
05-10-2002 02:15 PM
Re: Clearing all session environment variables
Btw, you will not be able to clear READONLY environment variables unless you are root.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2002 02:16 PM
05-10-2002 02:16 PM
Re: Clearing all session environment variables
Well, if you just want to execute a command without any environmental variables, you can do:
env -i
using:
env -i /usr/bin/ksh
would get you a shell sans your previous environemnt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2002 12:40 AM
05-11-2002 12:40 AM
Re: Clearing all session environment variables
what you want seems to be critical in my opinion. When leaving a session, you want to "unset" *all* environment variables??? This is not good, because a lot of these variables are necessary for your system to run. With a unset- command you will not unset the system-environment variables like PATH, TZ. These variables are protected, they can't be simply unset. If you created own variables, and exported them, they will be lost automatically when you finish the shell in which you created them. And if you changed values for any system variables, the old value, from before your session will be actual again, when you finish the shell.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:44 PM
05-12-2002 06:44 PM
Re: Clearing all session environment variables
try
# unset variable_name
-Niraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2002 06:57 PM
05-12-2002 06:57 PM
Re: Clearing all session environment variables
There's no easy way to do this - the best workaround I can think of is to simply logout and login again.
