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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list is too long - error

Status
Not open for further replies.

desbo

IS-IT--Management
Oct 24, 2002
64
GB
When logged in as one user I get the following error if I do the command "lpstat" and not all the printers are displayed:

"/usr/lib/lpd/bsdshort[64]: /usr/bin/awk: arg list too long"

But logged in as different user it works OK and all printers are displayed.

I also get the following error when trying to do an "ls -l" on a large list of files and no files are listed.

"ksh: /usr/bin/ls: 0403-027 The parameter list is too long."

I have put these errors together as I thought they may be solved by the same solution.

I am sure the answer to this simple so can anyone help

Thanks



 
I have a feeling that won't work, because the ls pipes all of its output in one go into xargs. In any case, the ouput would look a mess. Try
ls |xargs -n1 ls -al
instead.

 
"ls -a | xargs" - does not work

"ls |xargs -n1 ls -al" - works OK but then "ls -l" does the same

If I want to list all programs beginning with an "R" then the error comes up using "ls -l R*" and also comes up with "ls R*|xargs -n1 ls -al" or "ls |xargs -n1 ls R* -al"
 
I think what is happening here, is that the shell is matching all your R* files and expanding these into a list ( which is too big ). You need to stop the shell from doing this, and do your pattern matching a different way. The following should achieve this, although it might be a bit long-winded:
ls |xargs -n1 |grep "^R" |xargs ls -al

I'm sure someone will come up with an easier way.
 
what defines if a "list" is too big. Can't it be changed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top