in reply to find the xml files

grep -i "<name=>*.*Sydney*.*" $(find . -type f -name "*.xml" -print -e +xec grep -i '<book></book>' {} \;)
use the $(command) in bash

Replies are listed 'Best First'.
Re^2: find the xml files
by Anonymous Monk on Sep 14, 2009 at 12:28 UTC
    On executing the command I got message like this -bash: /bin/grep: Argument list too long

      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)))
      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