home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,428 of 68,980   
   JJ to Tom Del Rosso   
   Re: Output redirecting and piping   
   18 Jun 19 03:20:22   
   
   From: jj4public@vfemail.net   
      
   On Mon, 17 Jun 2019 07:24:38 -0400, Tom Del Rosso wrote:   
   >   
   > No I didn't mean it comes out all at once.  I meant I ran each one in a   
   > separate command, taking every process name from tasklist and using it   
   > as the parameter for the find command, like so:   
   >   
   > for %%a in (all process names) do tasklist | find /i "%%a   
   >   
   > The above shows one at a time, but FIND fails to see several, even   
   > though they are not processes that stop and start, and they are at   
   > various places in the list.  Putting SORT in the middle makes FIND see   
   > all of them.   
   >   
   > Yet, if tasklist output is saved in a text file and then redirected to   
   > FIND, all of them show up.  So the text file shows nothing unexpected   
   > but it also acts as expected.  The direct pipe, which apparently   
   > involves TASKLIST and FIND running together, doesn't work all the time.   
      
   What if the output is redirected to a file, then use TYPE with FIND? e.g.   
      
     tasklist > out   
     type out | find /i "firefox"   
      
   I know that this isn't an efficient method to find a text. It's just for   
   finding out whether TASKLIST is a part of this problem or not.   
      
   > Here's another one:  It comes and goes.  After a reboot, or just   
   > restarting firefox, it might work, but right now the output is:   
   >   
   > tasklist | find /i "firefox"   
   > firefox.exe                 3388 Console                 0    490,348 K   
   >   
   > tasklist | find /i "find"   
   > find.exe                    3148 Console                 0      2,528 K   
   >   
   > tasklist | find /i "fi"   
   > NOTHING!!!   
   >   
   > Then close and restart firefox, and this:   
   >   
   > tasklist | find /i "fi"   
   > firefox.exe                 3868 Console                 0    113,492 K   
   > find.exe                     364 Console                 0      1,764 K   
      
   That is weird indeed.   
      
   Try using FINDSTR in place of FIND. If FINDSTR doesn't have this problem,   
   then it's a bug in the FIND tool. Otherwise, something else is interfering   
   with the pipe.   
      
   --- 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