How can I make iconv replace the input file with the converted output?
I frequently connect to amazon ec2 using their public DNS names
ec2-12-34-56-78.compute-1.amazonaws.com) and because of this my
known_hosts file gets overwhelmed with a lot of
ec2 entries I will never use again.
I know I could probably use
sed -i to edit in place but I wanted to use
grep and so I did this:
grep -v ec2 ~/.ssh/known_hosts > ~/.ssh/known_hosts
known_hosts as an empty file. If I do:
grep -v ec2 ~/.ssh/known_hosts > ~/.ssh/tmp mv ~/.ssh/tmp ~/.ssh/known_hosts
then things are fine, but I am confused why reading and writing to the same file leaves it blank, and if there is any way around this when using