Path: 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 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