Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://582900]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-23 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found