Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ls - arg list too long

Status
Not open for further replies.

varajan

Technical User
Oct 5, 2001
42
0
0
IN
There is a line in one of our unix scripts:
filelist='ls mlp?????.dat'

This line is giving an error message:
/usr/bin/ls: arg list too long

How can I avoid this from happening ? I definitely don't want to look at any files besides mlp?????.dat.

Can somebody assist ?
 
You may try this:
filelist=""
for f in `ls`
do case $f in mlp?????.dat) filelist="${filelist}$f ";; esac
done

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top