sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #24881
Re: En smart search-and-replace oneliner?
On Thu, 13 Jul 2000, Jesper Hess Nielsen wrote:
> Hej Folkens
>
> Er der nogen der kender en smart hurtig måde at søge- og erstatte noget
> tekst i en række filer i et directory? Det jeg skal have erstattet er :
>
> /images/
>
> skal erstattes med
>
> http://www.ntvcommunications.dk/images/
>
> Nogen smart måde at gøre det på?
Noget ala (bash)
for FILE in `find . -type f` ;
do (sed s/images/http:\/\/www.ntvcommunications.dk\/images\// < $FILE >
$FILE.tmp && mv $FILE.tmp $FILE); done
Alt på een linie, check det først, virker ikke med filnavne med mellemrum.
mao: lidt shell
Mads
--
Mads Bondo Dydensborg. madsdyd@xxxxxxxxxxxx
Just because a program takes text commands makes it complex? I love GUI's. I
love using the web. I love WYSIWYG word processors. But I also love CLIs. It
feels more natural to me, as if I'm talking with the computer (granted, the
language isn't english, it's bash, and the vocabulary happens to be whatever's
is my PATH)--I tell it what to do and it does it for me (unlike GUI's where I
have to do everything my own damn self).
- fassler, in response to MS France FUD
Follow ups
References