Redirection caveat Eg: Suppose a program called prog: Reads from file.txt Does some processing Outputs to stdout prog file.txt > file.txt Contents of file.txt are deleted by the shell before prog is run! Thus prog reads an empty file And then outputs nothing So file.txt stays empty