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
8 More Discussions You Might Find Interesting
1. Linux
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
2. Shell Programming and Scripting
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
3. AIX
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
4. UNIX for Dummies Questions & Answers
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
5. Red Hat
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
6. Shell Programming and Scripting
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
7. Solaris
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
8. Programming
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