Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to keep VNC running' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to keep VNC running
Authored by: sven on Mar 05, '03 10:33:44AM

Just using "ps -auxc" instead of "ps -auxww" will allow you to drop the "grep -v" part:

if ps -auxc | grep OSXvnc; then
...

Out of curiosity: Why did you choose these options?



[ Reply to This | # ]
A script to keep VNC running
Authored by: Accura on Mar 05, '03 10:21:28PM

I work with unix (well BSD) geeks and have had these options forced on me by others, its now just an auto thing i do with ps, the best way to work out what you need is man ps. auxww seams to do everything by every user, also ps -aSx works as well.

---
"The time has come," the walrus said. "To talk of many things..."



[ Reply to This | # ]
ww and c
Authored by: grinnelljosh on Nov 13, '03 07:13:57PM

The original code prevents two bugs.
1. the 'ww' flag tells ps to not crop the textual output, which could screw up output (this has happened to me)
2. although the 'c' flag seems to do the job, it doesn't account for multiple processor machines, where two processes (grep and ssh, for instance) could be running at the same time



[ Reply to This | # ]