Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: find the xml files

by Anonymous Monk
on Sep 14, 2009 at 12:28 UTC ( [id://795105] : note . print w/replies, xml ) Need Help??


in reply to Re: find the xml files
in thread find the xml files

On executing the command I got message like this -bash: /bin/grep: Argument list too long

Replies are listed 'Best First'.
Re^3: find the xml files
by bv (Friar) on Sep 14, 2009 at 13:59 UTC

    Probably because you have too many XML files that contain <book></book>. Look into xargs, or the - option for grep.

    $ find /path -name '*.xml' -exec grep 'pattern1' {} /dev/null \; | cut -d: -f1 | grep 'pattern2' -

     

    print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))
Re^3: find the xml files
by Utilitarian (Vicar) on Sep 14, 2009 at 13:52 UTC
    Well that's probably because the argument list is too long ;)
    You can write a simple bash loop to get around this;
    for i in $(find . -type f -name "*.xml" -print -exec grep -i '<book></ +book>' {} \;);do grep -i "<name=>*.*Sydney*.*" $i && echo $i;done