[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ls arg list too long

Posted on 2004-11-15
2
Medium Priority
?
755 Views
Last Modified: 2008-02-01
Greetings experts,

This is not a homework assignment.  I have the following assignment in my script:
my @reportfiles = `/usr/bin/ls *.day | grep -v 00.day`;    

This yields sh: /usr/bin/ls: arg list too long

How do I correct this?

TIA for your help.
0
Comment
Question by:uluttrell
2 Comments
 
LVL 13

Accepted Solution

by:
gripe earned 1000 total points
ID: 12586847
You have more '*.day' files in your directory than ls can cope with. You could try using perl's internal globbing to do this:

my @reportfiles = grep { !/00\.day$/ } <*.day>;
0
 

Author Comment

by:uluttrell
ID: 12586884
Thank you gripe.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question