Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm very new to Linux /bash programming and I'm trying to redirect all console/session standard output to a file and then toggle it back. I can't seem to find any information on how this is done. All I can find is how to redirect output from commands. ie ls > file.txt which will not work for me. Any information or pointers will be greatly appreciated.
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500
Rep:
You'll have to be more clear in your description. What does "toggle it back" mean? Why will "ls > file.txt" not work for you? What are you trying to accomplish?
Basically I am trying to redirect all standard input/output/error from the terminal into a file? When I say toggle I would like to have a way of then putting this hijacking of the standard input/output/error back to its previous state. The reason why "ls > file.txt" will not work is because, and this is where its gets complicated, I am not running a command from the terminal but rather I am trying to perform this action from within a %trigger script inside and RPM. I left that out because it just confuses the matter.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.