#!/usr/bin/perl -w use strict; my $TTYFIRST = 2; my $TTYLAST = 17; my $start_ts = '"12/04/2000 07:00:00"'; my $end_ts = '"12/04/2000 08:00:00"'; my $selectedserver = 'ftwaeipd0001'; for (my $i = $TTYFIRST; $i <= $TTYLAST; $i++) { Tty_check($i,$start_ts,$end_ts,$selectedserver); } sub Tty_check { my $tty_string = 'tty'.$_[0]; my $tty = qx{echo 'aml_read /l trace /h $_[3] /a commproc /s $_[1] /b $_[2] /d all | egrep -c -e $tty_string'}; chomp($tty); print "