in reply to Re^3: Parsing /etc/remote
in thread Parsing /etc/remote

Unfortunately, the customers' /etc/remote will be as I have outlined above - without a colon. However, after reading the documentation, it seems that I should be able to set the TERMCAP environment variable to account for that, but I cannot seem to figure out how (Correction - to what. Any suggestions?

Replies are listed 'Best First'.
Re^5: Parsing /etc/remote
by serf (Chaplain) on Nov 29, 2005 at 16:12 UTC
    $ENV{TERMCAP} = "something"; sets the the TERMCAP environment variable, but I'm guessing you're asking *what* to set it to.

    Update:

    Nasty kludge?

    use strict; use warnings; use Term::Cap; my $PortName = 'MyPort'; if (scalar(@ARGV)) { $PortName = $ARGV[0]; } my $remote = "/etc/remote"; my $tmp_rem = "/tmp/remote.$$"; open (REMOTE, $remote) || die "Can't read '$remote': $!\n"; open (TMPREM, "> $tmp_rem") || die "Can't write to: '$tmp_rem': $!\n"; while(<REMOTE>) { s/$/:/ if /tc=[^:]+$/; print TMPREM; } close(TMPREM); close(REMOTE); $ENV{TERMPATH} = $tmp_rem; my $terminal = Tgetent Term::Cap { TERM => $PortName, OSPEED => 9600}; print $terminal->Tgoto('dv', "", "",), $/; unlink($tmp_rem);