Getting a process/program version from /proc folder


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Getting a process/program version from /proc folder
# 1  
Old 06-20-2012
Getting a process/program version from /proc folder

Hello

I am writing a script that will first execute ps to get the list of processes running, and the go into the /proc folder for each PID listed and gather relevant information.

I looked through the contents of a particular process in the /proc folder and I can't find where I can locate the version of the running process/program.

Ideally I don't want to get the name of the program and then execute a command to get the version of the program, because I am trying to write a script to do this constantly across a variety of machines; although most programs can reveal their version numbers using --version tag, it is not reliable and may differ per program.

Can anyone help?

Thanks
# 2  
Old 06-20-2012
It would be nice, but it's certainly not something you can extract from /proc/. Processes and executables don't really have that kind of embedded information. You'll have to deal with the programs and OSes the hard way.

There's systems that don't even have /proc by the way, like OSX and HPUX.
# 3  
Old 06-20-2012
thanks, only Linux is in scope for my script so I am not worried about cross OS just yet.

well thanks for the quick reply....I guess its going to be a If, else unknown...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

How to compile and run the ProC (*.pc) program?

Hi Team, I am very new to this forum and hope someone will help me in resolving the issue. I am new to Pro C also. I made some changes to the existing Pro C program and want to run the program with the changes. But I am unable to neither compile nor run the program. Please do the... (2 Replies)
Discussion started by: prakashs1218
2 Replies

2. Solaris

Logging the memory consumed by a process with c/C++ without using proc

I need to log the size of physical/virtual memory consumed by any given given process using c/c++ code running on solaris and aix without using the proc filesystem. Please advise. (1 Reply)
Discussion started by: Manisha Paul
1 Replies

3. Shell Programming and Scripting

does the pid of background process show in /proc?

Hi all, I'm reading <advanced bash scripting> and there is a example to kill a background process in a limited time,as shown below: #! /bin/bash #set -n TIMEOUT=$1 count=0 hanging_jobs & { while ((count < TIMEOUT));do eval ' && ((count = TIMEOUT))' ((count++)) sleep 1... (6 Replies)
Discussion started by: homeboy
6 Replies

4. Red Hat

Output of /proc/version

Hi, I am a newbie in Linux. Appended is the output of cat /proc/version and uname -a. # cat /proc/version Linux version 2.6.32.12-115.fc12.i686 (mockbuild@x86-03.phx2.fedoraproject.org) (gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) ) #1 SMP Fri Apr 30 20:34:53 UTC 2010 # uname -a... (7 Replies)
Discussion started by: Hari_Ganesh
7 Replies

5. UNIX for Dummies Questions & Answers

proc program compilation in unix

hi, i need to compile a proc program, say prog.pc can we compile this program in the unix environment? does this need a make file? can anyone help me on this since i am new to this area. Thanks in advance. (1 Reply)
Discussion started by: csprog
1 Replies

6. AIX

AIX equivalent to /proc/self/cmdline to get process name from C++ program

Hi, I'm porting some old C++ code (that I didn't write) from Linux to AIX and have run into a problem in getting the process name from within the code when it is run on AIX. Basically the code is getting the process name so it can then return it to the rest of the code as argv. This code is trying... (1 Reply)
Discussion started by: tbk
1 Replies

7. Shell Programming and Scripting

Error in script to automate the daily monitoring process of UNIX server and it's proc

hi friends, I am trying to automate the daily monitoring process of UNIX server and it's processes. the script are below i executed the above script using ksh -x monitortest1.sh in root login . It shows error at some lines . 1. i logged in using root ,but it... (8 Replies)
Discussion started by: rdhaprakasam
8 Replies

8. Linux

How to call a proc file from *.c program?

Hi, I am new to Linux programming. As part of learning, I need to create a *.c program where we call certain /proc files (i.e. such as meminfo, version, uptime, etc...) from our program. Can anyone point me to a simple program on how one would do this (i.e. can you directly call uptime() or... (4 Replies)
Discussion started by: pat_and_cami
4 Replies
Login or Register to Ask a Question