Re: Is there a better way to get current tty name
- From: godsarmycy@xxxxxxxxx ("Yue Chen")
- Date: Tue, 28 Oct 2008 14:09:54 +0800
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
- References:
- Is there a better way to get current tty name
- From: Yue Chen
- Is there a better way to get current tty name
- Prev by Date: Is there a better way to get current tty name
- Next by Date: Re: Curly braces and the logic of PERL
- Previous by thread: Is there a better way to get current tty name
- Index(es):
Relevant Pages
|