🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix
Article #359

Redirection

#359
From: Thomas Kwong
Date: Thu, 27 Dec 1990 00:31
25 lines
884 bytes
In the final exam ( Unix and C ) that I just take, one UNIX
problem is like this:

%cat myfile
word1 word2 word3
word4 word5
word6
%wc myfile
     3     6    36   myfile

%wc myfile > myfile
%cat myfile
     0     0     0   myfile

How come MYFILE becomes that?

I think it should be like:
     3     6    36   myfile
because output of wc myfile is redirected to myfile.

Can anybody tell me why?

Thomas Kwong.

------------------------------ 6600tom@ucsbuxa.ucsb.edu
Technical Details
Message-ID: <2307@megadon.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!apple!altos!megadon!clp

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!apple!altos!megadon!clp
From: 6600tom@ucsbuxa.ucsb.edu (Thomas Kwong)
Newsgroups: comp.unix
Subject: Redirection
Keywords: wc
Message-ID: <2307@megadon.UUCP>
Date: 27 Dec 90 00:31:53 GMT
Sender: clp@megadon.UUCP
Lines: 25
Approved: clp@megadon.UUCP