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,424 of 68,980   
   Tom Del Rosso to dr.j.r.stockton@gmail.com   
   Re: Output redirecting and piping   
   16 Jun 19 21:00:46   
   
   From: fizzbintuesday@that-google-mail-domain.com   
      
   dr.j.r.stockton@gmail.com wrote:   
   > On Sunday, 16 June 2019 16:17:51 UTC+1, Tom Del Rosso  wrote:   
   >> tasklist | sort >file.txt   
   >   
   >   
   > You might try   
   >        tasklist > file.txt   
   > to see whether tasklist actually outputs what you expect.   
      
   Sure, I tried that, and examined the txt file with a hex editor.  That's   
   how I know it isn't an issue of mis-matched CR LF (0D 0A).  There was   
   nothing unexpected.   
      
      
   > Also using 1> and 2> instead of just > might give a clue.   
      
   No difference, but 1> shouldn't make a difference, should it?  Of course   
   2> makes a 0 byte file.   
      
      
   > It might be useful to know what generation of Windows you are   
   > using, and which version - home, pro, or whatever.   
      
   This is a script I only need on an XP Home system.  It isn't happening   
   now on Win7 but it didn't happen on the XP system not long ago.   
      
   It's a curiosity but if the sort command fixes it that's good enough.   
   We know windows commands have bugs.   
      
   It's also interesting how piping works, since the sort command itself   
   appears in the task list, demonstrating that it started first.   
   Apparently it starts them in reverse order so stdio handles can be   
   duplicated and piped.  No more need for temp files.  But maybe that's   
   related to the problem.  It's a mystery why the output is as expected   
   but FIND doesn't see it all.   
      
   --- 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