How to put the STDOUT back to terminal


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to put the STDOUT back to terminal
# 1  
Old 10-02-2008
How to put the STDOUT back to terminal

I have put the file descriptor 1 to file, using command exec 1>>out.txt
Then I could not see any output on the screen, how could I restore the default output to terminal? Smilie Thanks
# 2  
Old 10-02-2008
Look into the tee command.
# 3  
Old 10-02-2008
First know the file attached to your terminal by issuing the command tty
and then use the same command again to change the file descriptor 1 to the file attached to your terminal

for e.g

[ajaykumarl@ajaykumar abc]$ tty
/dev/pts/6
[ajaykumarl@ajaykumar abc]$ exec
[ajaykumarl@ajaykumar abc]$ exec 1>>out
[ajaykumarl@ajaykumar abc]$ ls
[ajaykumarl@ajaykumar abc]$ exec 1>>/dev/pts/6
[ajaykumarl@ajaykumar abc]$ ls
out test
[ajaykumarl@ajaykumar abc]$



Thanks & Regards
ajay reddy
# 4  
Old 10-02-2008
Cool, thank you very much.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

2. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies

3. Shell Programming and Scripting

Put Script on Start-up the sh Terminal

Hi all I want to put this script on start-up the sh Terminal to save history of output: if ; then logdir=$HOME/terminal-logs if ; then mkdir $logdir fi gzip -q $logdir/*.log logfile=$logdir/$(date +%F_%T).$$.log ... (12 Replies)
Discussion started by: Rahim_T
12 Replies

4. Shell Programming and Scripting

Reading output from terminal back into bash script

How can I get a bash script to wait and read and count $i messages that a running program (drbl clonezilla) sends to the console (terminal) and only then move on to the next line in the script when the count is matched (the next line is the last line of the script and is a reboot)? The script... (0 Replies)
Discussion started by: dp123
0 Replies

5. Programming

how to redirect back to stdout

In my program, I am using library provided by other. In the library, the cout/cerr is redirected to a file (the file path is known). After I call some methods in the library, I get one side-effect --> The cout/cerr in my own program is also directed to the file. So how can I to redirect... (5 Replies)
Discussion started by: princelinux
5 Replies

6. IP Networking

Back-to-Back Connection using HBAs

Hi every body, Is it possible to connect two servers Back-to-Back (Point-to-Point) using HBA adapters & using Fiber. Note it is direct connection & there is no switches between the servers. I'm concern about using HBA adapters, it is possible or not. Thanks in advance. :) (3 Replies)
Discussion started by: aldowsary
3 Replies

7. AIX

back to back printing in UNIX

Hi , Can you suggest me how to back to back printing in UNIX? Is there any way? Kindly advise. Regards Vijaya Amirtha Raj (3 Replies)
Discussion started by: amirthraj_12
3 Replies

8. UNIX for Dummies Questions & Answers

stdout back to tty

Hi everyone! Well, this is the thing.. I sent a process's stdout to /dev/null. This process is very time consuming and after a week it keeps running, what I need is to switch the stdout back to screen to see what's going on. Anyone know if it's possible and how to do it? Thanks and... (3 Replies)
Discussion started by: piltrafa
3 Replies

9. UNIX for Advanced & Expert Users

connecting to unix through hyper terminal - as a dumb terminal

I just changed from windows NT to XP and I am no longer able to connect to my unix system. I used to use hyper terminal -- which acts as dumb terminal to my main frame unix system. I think one of the options used to be "direct to comX". This option isn't listed now. I use a serial port and the... (2 Replies)
Discussion started by: michelle
2 Replies
Login or Register to Ask a Question