Pipes You can redirect one program's output to another's input This removes the need for outfile if prog < test.in | cmp - test.out; then echo "test passed" else echo "test failed" fi