How to use gdb with pipes and stdin

cat 1.txt - | ./game

This cat is pointless, you could just as easily do this: ./game < 1.txt.

Which can also be used to run the game under GDB:

gdb ./game
(gdb) run < 1.txt

See also this answer.

Leave a Comment