[HPADM] convert shell script to perl

From: Neeraj Lal (neeraj_lal@fastmail.us)
Date: Tue Aug 17 2004 - 22:42:28 EDT


Hi Admin

Can any one help me in converting the following script into perl as I am
new to perl

#! /bin/csh -vx .f
#Variable Definition

set LogFile_Name = $1;
set Err_String_file = "Error_Strings.dat"
set Backup_Dir = "/home/lalne/logfiles"
set ext = `date -u | awk '{print $2$3$6$4$5}'`
#Checking For The Crash Error in Log File

 
set Return_Code = `tail -100 $LogFile_Name | /usr/bin/egrep -f
$Err_String_file | wc -l`
echo $Return_Code

if ( $Return_Code != 0 ) then
      cp $LogFile_Name $Backup_Dir/$LogFile_Name.$ext
else
      echo "No Problem"
endif

set Server_Name = `echo $LogFile_Name | awk -F. '{print $1}'`
set Infra_Name = `echo $LogFile_Name | awk -F. '{print $2$3$4}'`

echo "The Problem is on Server $Server_Name and Infra Name is
$Infra_Name"

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:42 EDT