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,673 of 135,536    |
|    rbowman to All    |
|    Re: Ridiculous Online Programming "Advic    |
|    11 Jan 26 22:31:23    |
   
   From: bowman@montana.com   
      
   On Sun, 11 Jan 2026 02:45:59 -0500, 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.   
      
   $ ps aux | wc   
    419 5866 71885   
      
    ps ax | wc   
    418 3347 55870   
      
   From 'man ps'   
      
    To see every process on the system using BSD syntax:   
    ps ax   
    ps axu   
      
      
   I suppose you think count(ss) isn't doing a sort of grep as it tests every   
   element in the list for ss.   
      
   I should thank you. It did inspire me to add   
      
   Find() {   
    find . -name $1 | xargs grep $2   
   }   
      
   to my .bashrc. I use it a lot and was always going to get roundtoit.   
      
   --- 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