I have to make a simple app for school.
I have to write arguments one per line on the terminal, and return on stdout the user choices.
For example, I write
cat my_app main.c main.h, if the user choose
main.c, then I return
main.c to cat. The problem is that if I write the menu on the standard output (aka STDOUT_FILENO), I return it to
cat. I could write my menu on STDERR, but it's a little ugly.
I don't really know how to use devices/files like
/dev/pty*, but I feel I could use them to write something on the terminal without having to write it on STDOUT or STDERR.
Basically, I want to open a new output, which would be shown by the terminal (STDOUT, STDERR, MYOUT).
I don't know if I explained it correctly.