Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Parsing /etc/remote

by serf (Chaplain)
on Nov 29, 2005 at 15:49 UTC ( [id://512681]=note: print w/replies, xml ) Need Help??


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

Although it doesn't seem to be required by the file format in the examples and man pages I've looked at, if the end of the alias line is terminated with a colon it will work as expected.

Replies are listed 'Best First'.
Re^4: Parsing /etc/remote
by gri6507 (Deacon) on Nov 29, 2005 at 16:00 UTC
    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?
      $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);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://512681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 12:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found