[Prev][Next][Index][Thread]
Re: a sed question...
Ira Abramov (at work) wrote:
>
> moving an entire tree of a website from .html to .htm, using foreach, I am
> trying to inject each file through such a commandline:
>
> cat 129.html | sed -e 'sg/.html/.htm/' > 129.htm
>
> i.e. changing the filename and the links inside at the same time.
>
> anyone has an idea why I get "sed: Unexpected End-of-file" on this? all
> the *.htm files are just opened and not even the first line is written...
> all are 0 bytes long.
You can't read and write the same file with sed. You'd have to move it
and then write it or the other way round. I'm not sure if your command
syntax is correct but the way I'd've written it would be
's/\.html/\.htm/g'
You've got to escape the dots unless sg is something different than
s///g which I know.
--
Yuval El-Hanany | Suzuki GS500E '94 |
ye@eng.amdocs.com | | Have backpack,
Home : 972-3-6046257 | Debian Linux Inside | will travel
Work : 972-3-5762971 | |
References: