Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Finding a Letter at Last line

by smokemachine (Hermit)
on Nov 08, 2006 at 15:58 UTC ( [id://582900] : note . print w/replies, xml ) Need Help??


in reply to Finding a Letter at Last line

could be this?
perl -e 'open FILE, "<file"; $_ = join "", <FILE>; print "Download fin +ished" if /^t[^\n]*\Z/msi'

Replies are listed 'Best First'.
Re^2: Finding a Letter at Last line
by mantra2006 (Hermit) on Nov 08, 2006 at 16:37 UTC
    Hey smokemachine
    Thanks for the reply..it worked..just a small doubt how can i replace "<file" with variable filenames??
    Thanks & Regards
    Sridhar
      yes... you can use "<$filename"
        Hey smokemachine
        just a small clarification...
        for file in `ls -1 *.txt` do #echo $file perl -e 'open FILE, "<$file"; $_ = join "", <FILE>; print "true" i +f /^t[^\n]*\Z/msi' done

        when I run this for loop nothing is printing on command line but
        when I run with individual filenames its returning true..what is wrong with it..
        Thanks & Regards
        Sridhar