Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Find all JPEG files in a directory

by spiritway (Vicar)
on Aug 12, 2005 at 05:03 UTC ( #483184=note: print w/replies, xml ) Need Help??


in reply to Find all JPEG files in a directory

Since this is a Linux environment, you can use the 'ls' command:

ls *.jp* > textfile

Not Perl, but it works in Linux.

Replies are listed 'Best First'.
Re^2: Find all JPEG files in a directory
by holli (Monsignor) on Aug 12, 2005 at 06:09 UTC
    #perl use File::Slurp; write_file ('filenameW', $ENV{OS} =~ /Windows/i ? `dir /b *.jpg` : `ls + *.jpg` );
    Update: changed single qutoes to backticks as originally intended.


    holli, /regexed monk/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://483184]
help
Chatterbox?
[jedikaiti]: Happy Thanksgiving Eve to my fellow American Monks
[jedikaiti]: or as I like to think of it, preparatory panic day

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2017-11-22 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (327 votes). Check out past polls.

    Notices?