[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [linux] script bash



Je voudrais un petit script pour faire le change automatiquement dans TOUS les membres *html d'un directory.
#!/bin/bash
find . -name '*.html' | while read f; do
   [ ! -f "${f}.old" ] && mv "$f" "${f}.old"
   sed 's!\\mrtg\\!/mrtg/!g' < "${f}.old" > "$f"
done

Ca te fait un backup des fichiers originaux comme .old
Si un fichier .old existe déjà, il ne sera *pas* écrasé.

--
  -o) Pascal Bleser   ATOS Origin/Aachen(DE) |
  /\\         <pascal.bleser@atosorigin.com> |
 _\_v <guru@linuxbe.org>                     |
---------------------------------------------|
Jesus saves,Buddha makes incremental backups :
---------------------------------------------'

_______________________________________________
Linux Mailing List
LCP - 11 Mai - http://www.unixtech.be/lcp.php
Archives: http://www.unixtech.be/mailman/listinfo/linux