On Tue, Feb 27, 2024 at 09:27:58AM -0500, Stefan Monnier wrote:
> > How does the script tell which connection is interactive?
> 
> Usually that's done by testing if the output is a tty.

user@host:~$ ssh ine...@cfarm110.cfarm.net cat tty.pl
#! /usr/bin/perl
print "tty(?)\n" if -t 1;
print "scripted(?)\n" unless -t 1;
user@host:~$ ssh ine...@cfarm110.cfarm.net
Last login: Tue Feb 27 &c.
ineiev@gcc1-power7:~$ ./tty.pl
tty(?)
ineiev@gcc1-power7:~$ logout
Connection to cfarm110.cfarm.net closed.
user@host:~$ ssh ine...@cfarm110.cfarm.net ./tty.pl
scripted(?)
user@host:~$

Attachment: signature.asc
Description: PGP signature

Reply via email to