home bbs files messages ]

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

   alt.os.windows-xp      One of my personal favourites!      146,966 messages   

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

   Message 145,076 of 146,966   
   Auric__ to Dave   
   Re: batch file echo something>a_file.txt   
   06 Mar 10 00:38:52   
   
   826ea956   
   From: not.my.real@email.address   
      
   On Fri, 05 Mar 2010 17:22:54 GMT, Dave wrote:   
      
   > Googled this and couldn't find anything.  Anybody ever seen this   
   > behavior before?   
   >   
   > test.bat consists of this one line:   
   > echo anything>somefile.txt   
   >   
   > run test.bat in a cmd window and you see this:   
   >   
   > C:\>test.bat   
   >   
   > C:\>echo anything 1>somefile.txt   
   >   
   > What is the 1, and where is it coming from?  It's not actually going   
   > into somefile.txt, just showing up in the cmd window.  I'm not a   
   > newbie, and have either just never noticed this before, or something   
   > is screwy with all 6 of my XP SP2 boxes.   
      
   You're redirecting stdout. I don't remember the terminology, but it's "1".   
   "2" is stderr, so you can redirect error messages (in programs that print   
   them to stderr) like this:   
     echo whatever 2>foo.txt   
      
   This is pretty normal. Try asking in alt.msdos.batch.nt.   
      
   --   
   Your insults carry little sting. Tiax knows he will rule in the end.   
      
   --- 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