- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Does ps command capture process name with spacing
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
11-21-2002 08:28 PM
11-21-2002 08:28 PM
Does ps command capture process name with spacing
ps -u taucadm | grep 'remsh AUCSUBH1_p startfp dbs 7500' | grep -v grep
and it doesn't seem to be running but if I replace the process 'remsh AUCSUBH1_p startfp dbs 7500' with sendmail process, it work fine. Any idea? is it because of the ps command cannot capture process name with spacing?
Here is the shell script that I used:
startfp_dbs_7500=
startfp_dbs_7500=`ps -u taucadm | grep 'remsh AUCSUBH1_p startfp dbs 7500' | grep -v grep`
if [ -z "$startfp_dbs_7500" ]
then
echo "startfp_dbs_7500 process not running"| mailx -s "Notification Message" ms_loo@yahoo.com
fi
Thanks
Rgds
Loo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2002 09:15 PM
11-21-2002 09:15 PM
Re: Does ps command capture process name with spacing
try
startfp_dbs_7500=
startfp_dbs_7500=`ps -u taucadm | grep 'remsh AUCSUBH1_p startfp dbs 7500' | grep -v grep`
if [ "_$startfp_dbs_7500" = "_$startfp_dbs_7500" ]
then
echo "startfp_dbs_7500 process not running"| mailx -s "Notification Message" ms_loo@yahoo.com
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2002 09:34 PM
11-21-2002 09:34 PM
Re: Does ps command capture process name with spacing
Still the same, cannot capture the process name with spacing. Any idea?
Thanks
Rgds
Loo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 01:03 AM
11-22-2002 01:03 AM
Re: Does ps command capture process name with spacing
try this (with space after equal sign):
# UNIX95= ps -u taucadm -eo args | grep "remsh AUCSUBH1_p startfp dbs 750[0]"
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 02:51 AM
11-22-2002 02:51 AM
Re: Does ps command capture process name with spacing
It is not problem with 'spaces in names', as in both cases you don't use names with spaces.
The command name is remsh and as this it is showed by 'ps'.
What do you need is to get commandline, instead of simple command name. John suggests option 'ps -o args', however it is not accepted on my machine, so it can be also on yours.
Use 'ps -f' instead. It replaces command name with command line and as far as I know is honored by every existing 'ps' command.
So complete would be: 'ps -fu taucadm'
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 03:27 AM
11-22-2002 03:27 AM
Re: Does ps command capture process name with spacing
Both John and Adam are right ... A simple ps will only display the program name. If you have a look at the 'exec' man page, you will see that a 'standard' call contains :
exec...(file, arg0, arg1, ...)
with args either as a list or as pointer to a list. In your case, 'ps' without option only displays arg0 (the executable file), while the option '-f' (and also the option -o args if yoy have respected exactly what John said, including space after UNIX95=) while also display arguments (arg1, ...)
But I also wanted to tell you that it's a good practice to assign points to people helping you), for example Adam and John. I can read :
This member has assigned points to 0 of 10 responses to his/her questions.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2002 03:31 AM
11-22-2002 03:31 AM
Re: Does ps command capture process name with spacing
if test $x=1
then
echo "startfp_dbs_7500 process not running"| mailx -s "Notification
else
echo Not running
fi
Thanks