On Fri, Nov 17, 2000 at 11:32:39PM +0000, Conor Daly wrote:

> That's the idea allright, in my case I want to check did I _actually_
> attach that file that I said I attached in the outgoing mail.  Now, what
> is /dev/tty ?  Is it different if I'm in an xterm than if I'm at a
> console?

>From the (HP-UX) tty(7) man page:

    The file /dev/tty is, in each process, a synonym for the control
    terminal associated with the process group of that process, if any.
    It is useful for programs or shell sequences that need to be sure of
    writing messages on the terminal no matter how output has been
    redirected.  It can also be used for programs that demand the name of
    a file for output, when typed output is desired and it is tiresome to
    find out what terminal is currently in use.

You can use /dev/tty from any type of terminal to refer to the current
terminal; it should work the same way from a console or an xterm.

>           I _did_ try redirecting input from whatever tty I was on at the
> time but unsucessfully.  It apeared to me that, since mutt was running in
> the same tty, _it_ was intercepting keyboard input rather than my script.

Well, if your program was running in the background at the same time
mutt was running in the foreground, then you would have trouble reading
from the tty.  When I've done that inadvertently, each program seems to
get about half the keystrokes, every other keystroke going to a
different program.  Otherwise, as long as mutt is suspended waiting for
your program to finish before it continues, you should be able to
redirect your program's stdin from the tty without any problem.

Maybe if you could provide more details of exactly what you did and
exactly how it failed, we might be able to figure out a solution.

Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | RF Communications Product Generation Unit
                             | Spokane, Washington, USA

Reply via email to