home bbs files messages ]

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,661 of 135,536   
   Rich to c186282@nnada.net   
   Re: Ridiculous Online Programming "Advic   
   11 Jan 26 20:31:13   
   
   From: rich@example.invalid   
      
   c186282  wrote:   
   > On 1/11/26 02:31, 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   
   >> }   
   >   
   >   "aux" creates a much larger text.   
   >   
   >   And, for this purpose, no 'grep' is needed   
   >   or desired.   
      
   Your .count() is implicity a "grep" in that to count it has to see if   
   "ss" exists on the line.  So the function is still there, even if it is   
   hidden behind the abstraction.   
      
   --- 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