[clug] Pseudo terminals

scudette at gmail.com scudette at gmail.com
Thu Jul 19 01:12:07 GMT 2007

On Wed, Jul 18, 2007 at 10:38:34PM +1000, David Tulloh wrote:
> That looks like a nice clean approach Brad.  Another alternative there 
> is the uber-hackish approach, get the xterm to report it's own tty.  In 
> crude pseudo code:
> $random = some unique random number/string
> xterm -T new -e "tty > /tmp/$random; $shell"
> $x = read(/tmp/$random);
> David

Or just list its open ptys by doing the equivalent in code of ls
/proc/pid/fd/ and resolving its symlinks. The pid can be gotten from the
system command.


> -- 
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux

More information about the linux mailing list