Thank you for your help and suggestions, but for some reason it is still not working. In Blacky's script; the $NOWC variable is still returning a value of zero. Here is the output of Blacky's script in debug mode:
Code:
XX# ./test_ps7.sh XXXXX
+ NO='ps -ef | grep NO | grep -v grep'
++ ps -ef
++ grep NO
++ grep -v grep
++ wc -l
+ NOWC=0
+ for CLIENT in '$*'
+ ssh XXXXX -l root 'if [ 0 -gt 0 ] ; then
echo '\''There are 0 processes running'\''
echo '\''Here is the list of processes'\''
eval ps -ef | grep NO | grep -v grep
fi
echo '\''Cannot find that process'\''
echo '\''Good Bye'\''
exit'
Cannot find that process
Good Bye
+ exit 0
In Chrism01's script the $CT variable has a value of 0. Here is the output of his script in debug mode:
Code:
XX# ./test_ps6.sh XXXXX
+ NO='ps -ef | grep NO | grep -v grep'
+ NOWC='ps -ef | grep NO | grep -v grep | wc -l'
+ for CLIENT in '$*'
++ eval ps -ef '|' grep NO '|' grep -v grep '|' wc -l
+++ ps -ef
+++ grep NO
+++ grep -v grep
+++ wc -l
+ ssh XXXXX -l root 'CT=0 ; if [[ -gt 0 ]] ; then
echo There' are processes 'running
echo Here' is the list of 'process
eval ps -ef | grep NO | grep -v grep
fi
echo Cannot' find that 'process
echo Good' 'Bye!!!
exit'
Cannot find that process
Good Bye!!!
+ exit 0
XX#
Thank you so much in taking time out to post and helping me out. Please advise.