I'm no scripting expert but....
The only condition test I see here is the "if" statement, which is not in the loop. The loop simply runs as long as there are entries in whatever is generated by the statement `ps -eaf.........2{'`
You might want to test this statement by itself to make sure it is producing what it is supposed to.
Other issues:
What output does "sleep 30" generate? (You are using a pipe, which presumes there is an output to be piped to the next command.)
Why the backticks here?:
Quote:
`echo "cd /home/xmuser/CQ/var/bin"`
|
2 problems here:
First, this will produce literally the string in the double-quotes. Second if you intended to have the output of the more command, then how would the paging for "more" be done? (ie, I'm not sure if you can really use "more" in a script.)