- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- obtaining environment variables for any process
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
тАО07-31-2000 08:42 AM
тАО07-31-2000 08:42 AM
obtaining environment variables for any process
It is easy to get the environment variables for the current process, but I have been unable to figure out a way to get this information for another process.
Any help would be greatly appreciated :-)
Thanks :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 08:48 AM
тАО07-31-2000 08:48 AM
Re: obtaining environment variables for any process
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 09:30 AM
тАО07-31-2000 09:30 AM
Re: obtaining environment variables for any process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 09:36 AM
тАО07-31-2000 09:36 AM
Re: obtaining environment variables for any process
Sorry I cannot help. However, you may get more hits from this forum if you state what you are trying to accomplish.
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 10:35 AM
тАО07-31-2000 10:35 AM
Re: obtaining environment variables for any process
For example, the DISPLAY variable. Suppose I wanted to pull out all processes with a certain value for the DISPLAY variable.
So, this is why I would like to access the environment variables for another process.
Thanks for your replies :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 10:08 PM
тАО07-31-2000 10:08 PM
Re: obtaining environment variables for any process
I don't know a way to get environment variables of processes, but if you do a
who -R
you get the IP-adresses of the terminals where users login from
If you match the tty and pts names of the users with the tty and pts names of the ps -ef output, you may get what you want.
Regard, Andre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 10:39 PM
тАО07-31-2000 10:39 PM
Re: obtaining environment variables for any process
You might try the pstat_getproc(2) call. It retrieves information about one or more processes from the kernel structures.
I don't have a HP-UX server at hand right now, so I can't exactly tell what kind of information it retrieves. You should have a look at the pst_status struct in /usr/include/sys/pstat.h
The manpage for pstat contains examples on how to use the series of system calls.
Hope this helps,
Rik.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2000 11:25 PM
тАО07-31-2000 11:25 PM
Re: obtaining environment variables for any process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-01-2000 09:25 AM
тАО08-01-2000 09:25 AM
Re: obtaining environment variables for any process
Can you give a better example of what you need to do?
I dont think that you can do what you need to, unless you are running something like screens, which allows connects and re-connects to the same tty, but can not give any work arounds without more information.
I.E.
I have used my own scripts for tracking things. I.E. A user running certain programs. I re-name the program, and create a script which launches the program, but only after logging the username, date, time, environment, etc....The log is mailed to me, or dumped to the system, and the user never knows the better :)
Best regards
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2000 07:03 AM
тАО08-02-2000 07:03 AM
Re: obtaining environment variables for any process
Basically, if you were to add a line to each .profile to echo the current environment (env, set, etc.) to a file, this file could be examined for the environment.
Also, if you have even more control over your machine & users -- you could even set up a script to be used instead of the "export" command. This script would echo all new exported environment variables to the user's 'environment' file (created per the previous paragraph) before it actually exported the environment variable.
I don't know if this would be worth your while or give you what you need -- but, it is an option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2000 07:27 AM
тАО08-02-2000 07:27 AM
Re: obtaining environment variables for any process
when a user logs is depends on what shell they are using for example ksh , if there is an /etc/profile that runs first and the if there is a local .profile that runs. Environment variables maybe set within these profiles , for specific users or a global entry depends which profile you are running.
One way you can check the environment variables is in the users profile before the application is started put in a sh ( indicates go to shell) and then typer in env
this will list environment variables set for that particular user ..
hope this helps
Dev