in reply to One-line shell script for find and replace

perl -pi -w -e 's/find/replace/g;' subdirectory/*.txt
??

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: One-line shell script for find and replace
by blazar (Canon) on Oct 05, 2005 at 08:23 UTC
    perl -pi -w -e 's/find/replace/g;' subdirectory/*.txt [download]
    ??
    To quote from the root node:
    perl -pi -w -e 's/find/replace/g;' *.txt
    How do I make the above one-liner to find and replace in sub-directories ?
    which suggests he wants to traverse a directory tree recursively.
      Eg:
      1. home/xyz.txt
      2. home/contacts/abc.txt
      3. home/contacts/addresses/pqr.txt

      Within the 'home' directory I need to find and replace a particular word in all text files (xyz.txt, abc.txt, pqr.txt)
        1. How does this comment apply to the node you're replying to?
        2. How do the replies you already got fail to answer your question?
        Re the first point indeed I was explaining this to the person who had suggested subdirectory/*. So why do you write that to me rather than to him/her?