|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
arg list too long
Does anyone have a solution for arg list too long error.
I have got this from the web but I fail to make any sense out of it Quote:
enc |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Check out the xargs command. Can you post the command that is failing?
|
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
I have a dirctory(in fact many directories) for which I have to grep
a certain string -In my case a 10 digit number starting with 011 code: Quote:
/usr/bin/grep Arg list too long Would find command help me? find . -name * -exec egrep '^011......$' /dev/null {} \; Thanks enc |
|
#4
|
||||
|
||||
|
I think the find syntax as you have it will have the same problem. If you use xargs like this you may have some luck. I am not anywhere I can test it right now to confirm for you but this syntax may work:
find ./ -print | xargs grep '^011.......$' *| cut -f1 -d : If you run this from your top level directory where you were running your script, you should get the results you want. |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Quote:
xargs: a single arg was greater than max argsize of 2048 characters Any Ideas?? enc |
| Sponsored Links | |
|
|
#6
|
||||
|
||||
|
Drop the "*" from the grep,
find ./ -print | xargs grep -l '^011.......$' You also won't need the cut, use -l (ell) to grep to print the matching filenames. Cheers ZB |
| Sponsored Links | |
|
|
#7
|
||||
|
||||
|
Thanks jazzybob you saved my day!!
But I was wondering why find ./ -print | xargs grep '^011.......$' *| cut -f1 -d : did not work in the first place. Chill enc |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| arg list too long | Zenwork | Shell Programming and Scripting | 2 | 10-08-2008 03:06 PM |
| Arg List too Long in SCP | chris1234 | UNIX for Dummies Questions & Answers | 5 | 02-27-2008 07:40 AM |
| ksh: /usr/bin/ls: arg list too long | jitindrabappa | UNIX for Dummies Questions & Answers | 2 | 10-12-2006 03:08 AM |
| ls -t arg list too long | CSU_Ram | UNIX for Dummies Questions & Answers | 4 | 05-05-2005 10:19 AM |
| arg list too long | vingupta | UNIX for Dummies Questions & Answers | 5 | 08-02-2001 11:43 PM |
|
|