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,629 of 135,536    |
|    Nuno Silva to rbowman    |
|    Re: Ridiculous Online Programming "Advic    |
|    11 Jan 26 10:32:08    |
   
   From: nunojsilva@invalid.invalid   
      
   On 2026-01-11, rbowman wrote:   
      
   > On Sat, 10 Jan 2026 20:14:49 -0500, c186282 wrote:   
   >   
   >> def AmRunning(ss) :   
   >> return os.popen("ps ax").read().count(ss) # get, unwrap, count   
   >   
   > .bashrc   
   > AmRunning() {   
   > ps aux | grep $1 | wc -l   
   > }   
      
   These two produce an off-by-one, right?   
      
   (Assuming .count() counts lines, otherwise it's off-by-at-least-one in   
   that one?)   
      
   > $ AmRunning brave   
   > 32   
   >   
   >   
   > Before Linux distros mostly switched to bash I used tcsh. You could do a   
   > lot more with alias without having to write a function.   
      
   --   
   Nuno Silva   
      
   --- 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