#!/usr/bin/perl -w use strict; my $hostname="localhost"; my $port=23; #my $username="testuser1"; #my $password="1helpnow"; #my $username="testuser2"; #my $password="1please"; my $username="testuser3"; my $password="1password"; use Net::Telnet(); my $t = new Net::Telnet (Timeout=>10, Prompt=> '/[\$%#>\d\w\r] $/'); $t->dump_log("log.telnet.dat"); $t->open(Host => $hostname, Port => $port); $t->login($username, $password); my @lines = $t->cmd("who"); $t->lastline; $t->close; print "@lines\n"; #### RED="\[\033[1;31m\]" # Color Definitions for bash LIGHT_RED="\[\033[1;31m\]" BLUE="\[\033[1;34m\]" WHITE="\[\033[1;37m\]" NC="\[\033[0;0m\]" # No Color PS1="${TITLEBAR}\ $BLUE[$RED\$(date +%I:%M)$BLUE]\ $BLUE[$LIGHT_RED\u@\h:\w$BLUE]$WHITE#$NC "