Peter Ross <Peter.Ross(at)alumni.tu-berlin.de> wrote:
> Ich habe mal ein Skript geschrieben, mit dem ich in einem Verzeichnisbaum
> dateiweise Links zu einem anderen erzeuge und dabei welche
> ausklammern kann (geplant und genutzt fuer /etc).
>
> Macht grob gesehen ein find und ein ln und denkt an ein paar Ausnahmen.
In dem Zusammenhang möchte ich mal das kleine Tool »cpio«
in Erinnerung rufen, insbesondere die -l Option:
cd $alt; find . | cpio -dumpl $neu
erstellt unter $neu einen »Shadow-tree« aus Hardlinks auf
den Verzeichnisbaum unter $alt.
Indem man in die Pipe zwischen find|cpio noch ein grep,
awk oder sonstwas einfügt, kann man beliebig filtern und
beeinflussen, was gelinkt wird und was nicht. Beispiel:
cd $alt; find . | egrep -v '\.(o|a|BAK)$' | cpio -dumpl $neu
klammert alles aus, was auf ».o«, ».a« oder ».BAK« endet.
Man kann natürlich auch find-Primaries verwenden:
cd $alt; find . -not -user nobody | cpio -dumpl $neu
läßt alles weg, was »nobody« gehört.
Gruß
Olli (cpio-Fan)
-- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead." -- RFC 1925 To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org with "unsubscribe de-bsd-questions" in the body of the messageReceived on Sun 11 May 2003 - 13:40:13 CEST