1 |
Drake Wyrm wrote: |
2 |
> Since you certainly seem to know what you're talking about, I have a |
3 |
> couple of silly follow-up questions on the topic. |
4 |
> |
5 |
> Would '>/dev/tty' (controlling terminal) work also, or would that end up |
6 |
> just going to the pty anyway? I'm fairly certain that the latter case |
7 |
> would be correct; I just want a second opinion. :-) |
8 |
|
9 |
/dev/tty refers to the current tty device, the controlling terminal. |
10 |
Independent if this a virtual console (vc = e.g. /dev/tty1 or /dev/vc/1) |
11 |
or pseudoterminal (pty = e.g. /dev/pts/11 allocated by sshd). Writing to |
12 |
/dev/tty and writing to the vc/pty will have the same result. So you're |
13 |
right, the latter case is correct. |
14 |
|
15 |
> What I'm not sure about, is whether /dev/console would work. I might try |
16 |
> this out later, but what do you think? |
17 |
|
18 |
/dev/console refers to the system console. It groups the virtual |
19 |
consoles /dev/tty* together and allows you to switch between them. In |
20 |
former times it was a symlink to one of /dev/tty*, but since Linux |
21 |
2.1.71 it is controlled by the kernel. /dev/tty0 refers to the current |
22 |
virtual console. Output send to /dev/tty* will be displayed through |
23 |
/dev/console, so redirecting setterm's stdout to /dev/console should |
24 |
have (almost) always the same result as redirecting stdout to /dev/tty*. |
25 |
So /dev/console should work also. |
26 |
|
27 |
Sven |