I am facing a slight problem in my project. I have a menu driven program and one of my options is Display all, which displays all the entries from a map using a loop. The display is on the terminal and I am not being able to view all the entries because it only shows the last few entries before my prompt comes again. I want the output to be redirected to a file so that I can use more commands and give the user a view accordingly. Please suggest few commands or code.
|
|
You can set up a pipeline when you launch your program to write its output to a file.
If the program does other things with the output, such as prompt the user for input, it is likely that it uses the second output channel (the error channel) to show menus, so it is possible that this won't get in the way of normal operation and will only capture dump output. Additionally, programs such as GNU If that doesn't work, tell us more about your program and usage. |
|||||
|
|
You can redirect terminal output to a file using this syntax:
|
|||
|
|
|
Standard output (stdout):
or if you want to append:
Standard error (stderr):
or if you want to append:
|
||||
|
|