Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-20-2012
Registered User
 
Join Date: Oct 2011
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 06-20-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,376
Thanks: 491
Thanked 2,535 Times in 2,418 Posts
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.
Sponsored Links
    #3  
Old 06-20-2012
Registered User
 
Join Date: Oct 2011
Posts: 31
Thanks: 2
Thanked 0 Times in 0 Posts
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...
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Output of /proc/version Hari_Ganesh Red Hat 7 07-02-2010 02:12 AM
AIX equivalent to /proc/self/cmdline to get process name from C++ program tbk AIX 1 10-27-2009 07:53 AM
How to call a proc file from *.c program? pat_and_cami Linux 4 02-15-2006 01:24 AM



All times are GMT -4. The time now is 12:02 PM.