Re: Sed Replace Script
Mark Edgar <[email protected]>
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <CABHMh_2XLm4wQwg4FDLcJ47=4UxoZxvVFOY+8CKKzHERm4K-2Q@mail.gmail.com> |
On Wed, Apr 18, 2012 at 2:00 PM, Quincey Robertson <[email protected]> wrote: > #! /bin/sed Why this line? I think you meant to use #!/bin/sh. This should work, if I'm correctly guessing your intentions (and assuming GNU sed's -i option is available): find . -type f -name '*.py' -exec sed -i 's/python/python2.4/g' {} + FYI: http://www.dwheeler.com/essays/filenames-in-shell.html is a great article about properly handling filenames. -Mark