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 [email protected] cat tty.pl #! /usr/bin/perl print "tty(?)\n" if -t 1; print "scripted(?)\n" unless -t 1; user@host:~$ ssh [email protected] 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 [email protected] ./tty.pl scripted(?) user@host:~$
signature.asc
Description: PGP signature
