My encoder
is a program that encodes a piece of text and prints the encoded text to the standard output. But when I do:
cat file.txt | encoder > file.txt
what happens is that all the text in file.txt
is completely erased and there remains nothing in it.
Why does this happen? Is there something wrong with the command?
Note: There is nothing wrong with encoder. It works perfectly. I can achieve what I want with
cat file.txt | encoder > file2.txt