The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-23-2008
arsidh arsidh is offline
Registered User
  
 

Join Date: May 2008
Posts: 6
Exclamation passing variable from bash to perl from bash script

Hi Yogesh,
Thanks for your valuable input, and Thanks for reply on it.
I have included the sugeestion , you told me, But When i run it , i am not getting any data, which i want, but the comment from the file.

Here is the Modified Code :
===========================

#!/bin/bash

FROM_DATE="04/05/2008"
TO_DATE="06/05/2008"


perl -ne 'print if ( $_ >= $ENV{'FROM_DATE'} && $_ <= $ENV{'TO_DATE'} )' monitor.audit
exit
=====================================
The output is only the commented line

#Memory Usage
#Check the Availability
#Disk Monitor
#Load Monitor
#Memory Usage
#Check the Availability


The file monitor.audit data
====================


04/05/2008-12:16r:453
04/05/2008-12:16::77
04/05/2008-12:16::138
#Load Monitor
04/05/2008-12:16ra:0.39
04/05/2008-12:16::9.01
04/05/2008-12:16::0.39
#Memory Usage
04/05/2008-12:16raprd01:13
04/05/2008-12:16::18
04/05/2008-12:16::18
#Check the Availability
04/05/2008-12:32ra:453
04/05/2008-12:32::77
04/05/2008-12:32::138
#Load Monitor
============================================

Can you please , tell what i need to do
Thanks
Arsidh