HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- check number of process
Operating System - HP-UX
1838652
Members
3681
Online
110128
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
03-12-2008 03:26 PM
03-12-2008 03:26 PM
check number of process
Do you know what is the operator or sintax for display a echo for check process -lt 2 and -gt 164 for example i have the next sintax: (My question is in ??)
PROCS=`ps -fu $USERID | grep FND |grep appltest|wc -l`
if [ $PROCS -gt 164 ];
then
echo "\n\t Process is running"
else
if [ $PROCS -lt 2 ];
then
echo
echo "\n\t Process is not running"
else
?? if [ $PROCS -lt 2 and -gt 164 ];
then
echo
echo "\n\t Process is waiting"
PROCS=`ps -fu $USERID | grep FND |grep appltest|wc -l`
if [ $PROCS -gt 164 ];
then
echo "\n\t Process is running"
else
if [ $PROCS -lt 2 ];
then
echo
echo "\n\t Process is not running"
else
?? if [ $PROCS -lt 2 and -gt 164 ];
then
echo
echo "\n\t Process is waiting"
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2008 04:26 PM
03-12-2008 04:26 PM
Re: check number of process
Stop and think about your last if statement for a minute. Do you see any problem with your logic?
How is it possible for PROCS to be less than 2 adn greater than 164 at the same time? Answer -- It's not.
I **think** you may really mean if PROCS is greater than 2 and less than 164? Regardless your last statement is redundant. Get rid of it completely, like:
PROCS=`ps -fu $USERID | grep FND |grep appltest|wc -l`
if [ $PROCS -gt 164 ];
then
echo "\n\t Process is running"
elif [ $PROCS -lt 2 ];
then
echo
echo "\n\t Process is not running"
else
echo
echo "\n\t Process is waiting"
fi
How is it possible for PROCS to be less than 2 adn greater than 164 at the same time? Answer -- It's not.
I **think** you may really mean if PROCS is greater than 2 and less than 164? Regardless your last statement is redundant. Get rid of it completely, like:
PROCS=`ps -fu $USERID | grep FND |grep appltest|wc -l`
if [ $PROCS -gt 164 ];
then
echo "\n\t Process is running"
elif [ $PROCS -lt 2 ];
then
echo
echo "\n\t Process is not running"
else
echo
echo "\n\t Process is waiting"
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2008 04:49 AM
03-13-2008 04:49 AM
Re: check number of process
I'm not sure I get what the relation from number of processes and "running", "not running" and "waiting"? Unless you need 164 processes for the application to be "running"?
If you really really want to do that and you can use:
if [ $PROCS -lt 2 -a -gt 164 ]; then
As Patrick says, this will always be false.
You probably want:
if [ $PROCS -ge 2 -a -le 164 ]; then
And this will always be true because of your previous ifs.
If you really really want to do that and you can use:
if [ $PROCS -lt 2 -a -gt 164 ]; then
As Patrick says, this will always be false.
You probably want:
if [ $PROCS -ge 2 -a -le 164 ]; then
And this will always be true because of your previous ifs.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP