Redirection

Steven Freed CIRT sfreed at ariel.unm.edu
Fri Dec 28 03:44:34 AEST 1990


>%wc myfile
>     3     6    36   myfile
>
>%wc myfile > myfile
>%cat myfile
>     0     0     0   myfile
>
>How come MYFILE becomes that?

because the original "myfile" gets overwritten by the new "myfile"
(from the redirection) by the shell BEFORE wc is run, therefore,
the only thing wc sees is an empty file.



--

Thanks,
Steve.                    sfreed at ariel.unm.edu



More information about the Comp.unix mailing list