Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.os.linux.misc    |    Linux-specific topics not covered by oth    |    135,536 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 134,674 of 135,536    |
|    rbowman to Nuno Silva    |
|    Re: Ridiculous Online Programming "Advic    |
|    11 Jan 26 22:51:57    |
   
   From: bowman@montana.com   
      
   On Sun, 11 Jan 2026 10:32:08 +0000, Nuno Silva wrote:   
      
   > These two produce an off-by-one, right?   
      
   The bash version does since it also counts 'grep --color=auto watchdogd'   
   along with the watchdogd process itself.   
      
   improved version:   
      
   AmRunning() {   
    ps aux | grep -v "grep" | grep $1 | wc -l   
   }   
      
      
   $ AmRunning firefox   
   11   
      
   That was an unexpected result since Firefox wasn't running. Further   
   investigation revealed Tor was showing its roots   
      
   tor-browser/Browser/firefox.real   
      
   Kill Tor and   
      
   $ AmRunning firefox   
   0   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca