- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ps -elf | grep ???
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
09-01-2003 01:21 AM
09-01-2003 01:21 AM
ps -elf | grep ???
I would like to automatically know if some processes are running using a generic 'ps -lef | grep
For now
Has someone ideas to complete my expression?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 01:27 AM
09-01-2003 01:27 AM
Re: ps -elf | grep ???
I think you want;
grep "^vmid$"
which means a process which starts with vmid and ends with vmid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 01:37 AM
09-01-2003 01:37 AM
Re: ps -elf | grep ???
ps -ef|grep " vmd "
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 01:49 AM
09-01-2003 01:49 AM
Re: ps -elf | grep ???
# ps -ef | egrep vmd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 02:06 AM
09-01-2003 02:06 AM
Re: ps -elf | grep ???
or
PID=$(ps -e|awk '($NF=="name-process"){ print $1 }')
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 02:25 AM
09-01-2003 02:25 AM
Re: ps -elf | grep ???
First point, I want an unique expression to look after a process, as I want to use it within a script.
Second point, I must use the -x option for ps to differentiate some processes (eg : Xtalk rulemanager process).
Third point, I do not want false positive. When I am looking for a process named vmd, I do not want to find cmlvmd nor vmdix. The $ anchoring will work for this case, but not for the syslogd process (launched with -D option, which appear due to the -x option of the ps command).
I know my question is quite complex, but that is the reason why I need your help. ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 02:41 AM
09-01-2003 02:41 AM
Re: ps -elf | grep ???
ps -ex | awk '{printf("%s \n", $0)}' | grep "[ |/]
If someone can find something shorter, without the awk for example, I would be very interested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 02:55 AM
09-01-2003 02:55 AM
Re: ps -elf | grep ???
Run the application from a script which then goes to sleep. If the application dies, the script will receive a SIGCHLD which you can process to either alert, restart the application or whatever. In other words, rather than checking if the process is running, be informed when it isn't.
Of course, this doesn't work if the application does the traditional fork/exit but it can be useful for monitoring running apps, especially if you use one generic application starting script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 03:14 AM
09-01-2003 03:14 AM
Re: ps -elf | grep ???
Have you tried the -w option ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 03:24 AM
09-01-2003 03:24 AM
Re: ps -elf | grep ???
UNIX95= ps -e -o 'pid,vsz,comm'
you can retrieve the reqd. colums.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 03:52 AM
09-01-2003 03:52 AM
Re: ps -elf | grep ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 03:58 AM
09-01-2003 03:58 AM
Re: ps -elf | grep ???
http://hpux.cs.utah.edu/hppd/hpux/Gnu/grep-2.5.1/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 04:23 AM
09-01-2003 04:23 AM
Re: ps -elf | grep ???
Frpom the man page of grep:
-w Select only those lines containing matches
that form whole words. The test is that the
matching substring must either be at the
beginning of the line, or preceded by a non-
word constituent character. Similarly, it
must be either at the end of the line or
followed by a non-word constituent character.
Word-constituent characters are letters,
digits, and the underscore.
I run HP-UX 11.11 with the standard grep (no GNU-version).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 04:28 AM
09-01-2003 04:28 AM
Re: ps -elf | grep ???
It seems it is exactly what I need. I will test it as soon as possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2003 09:17 AM
09-01-2003 09:17 AM
Re: ps -elf | grep ???
does this work on your system?
# UNIX95= ps -e -opid -ocomm| grep "[[:space:]]vmd$"
Btw, I think the -w option for grep in hpux is only for 11.11 and later.
regards,
John K.