![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pseudo-terminal will not be allocated because stdin is not a terminal. | Shivdatta | UNIX for Advanced & Expert Users | 1 | 08-04-2008 11:29 AM |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | UNIX for Dummies Questions & Answers | 3 | 08-02-2008 06:21 PM |
| How to write to stdin of another program (program A -> [stdin]program B) | vvaidyan | High Level Programming | 1 | 04-30-2008 02:44 PM |
| what difference between "terminal" and "console" | chenhao_no1 | High Level Programming | 1 | 09-09-2002 10:46 AM |
| connecting to unix through hyper terminal - as a dumb terminal | michelle | UNIX for Advanced & Expert Users | 2 | 11-05-2001 03:32 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
By convention every process has three standard file descriptors open when it is started by a shell.
0 - stdin 1 - stdout 2 - stderr and when you log on from a console, serial terminal or use xterm or ssh then all of these normally are open on /dev/tty which maps to your "controlling terminal". Notice that when you type three main things happen: 1. you can press delete and do basic editing 2. nothing happens until you press return 3. you can do flow/control with ctrl-S and ctrl-Q. This is referred to as 'cooked' mode, and all terminals can operate either cooked or raw. Files or pipes on the other hand can only be raw unless special effort is made to pipe through a pseudo-terminal. Being able to replace stdin with reading from a file or the output of another program is very powerful, but sometimes a program needs to know if it is reading from a terminal or not, this is also often counted as "interactive" or not. A program can do this with "istty". |
|
||||
|
Ah, some programs explicitly open /dev/tty in order to read from the terminal and do not want piped input. A good example is a program (eg ssh) that needs to read a password, it wants it typed in by a person.
|
|
||||
|
Quote:
But not always, in the case of password-less ssh through the use of keys in .ssh directory. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|