Re: Is there a better way to get current tty name



Sorry, I've got the answer.

It should be

$mytty = POSIX::ttyname(1);

2008/10/28 Yue Chen <godsarmycy@xxxxxxxxx>:
Hi

I am writing a perl script which need send current tty to another program.

Now i am using external cmd 'tty' and redirect the result to my
variable, such as:

$mytty = `tty`;


Since sometimes 'tty' is not in my PATH, my script is not always
successful. So is there a better perl internal mechanism to get such
variable?

Thank you very much

.



Relevant Pages

  • Is there a better way to get current tty name
    ... I am writing a perl script which need send current tty to another program. ... Now i am using external cmd 'tty' and redirect the result to my ...
    (perl.beginners)
  • Re: documentation for vm86()
    ... Now I am writing a module for controlling the IO devices. ... necessary to open the new tty? ... There is one signal handler ...
    (comp.os.linux.development.system)
  • Re: Problem with smpatch in a script
    ... > to be causing it to buffer output when it's not writing to a tty. ... then the standard solution is to use expect to give it one and ...
    (comp.unix.solaris)
  • Re: Terminal Font
    ... That was what I was thinking about he was writing about. ... some very cool fonts available for tty as well. ... You are about to enter another dimension, ...
    (alt.os.linux.suse)