Is there a better way to get current tty name



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

  • Re: 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: Redirection output for a program in background
    ... to redirect the standard output on the fly to a terminal ... The script could determine the tty. ... making the user a member of the group tty would solve it. ...
    (comp.os.linux.misc)
  • Re: Redirection
    ... can i redirect the output to tow different terminals? ... Pipe it into the appropriate device. ... Use tty to get the terminal's ...
    (alt.os.linux)
  • carp() / STDERR
    ... Im runnin a script which detatches from the tty and uses carp in ... Is there any way i can redirect the STDERR messages to a ...
    (comp.lang.perl.misc)
  • Re: Redirecting output
    ... > want to redirect the standard output of printk to my xterm. ... > it is redirected to tty. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)