I have my own command line program which I am running on the terminal. How might I redirect the output from this program to file so that I can see a hex representation of it? I also wish the control characters outputted from the program to be saved to hex.
UPDATE
My program also receives commands on the terminal via std input. It seems doing:
myprogram 9889 > output.txt
or even
myprogram 9889 | xxd
disrupts the program in some manner such that I cant seem to get the program to respond to inputted commands.