View previous topic :: View next topic |
Author |
Message |
hitachi Guru
Joined: 20 Feb 2006 Posts: 478 Location: Freiburg / Deutschland
|
Posted: Thu Nov 13, 2008 11:26 am Post subject: Frage zu pipe |
|
|
Hallo,
ich habe mal wieder eine Alltagsfrage, für die mit Sicherheit die Antwort nicht fern liegt. Ich benenne meine Bilder immer nach den Personen und sortiere diese dann in Ordern nach Datum. Jetzt will ich eine Kopie mit allen Bilder von "Heinz" aus dem Jahr 2008 im Ordner ~/hierhin ( oder besser direkt mit mkisofs -J -R -o ~/hierher/bild.iso )
Finden kann ich die Bilder auf folgendem Weg: Code: | locate heinz | grep 2008 | grep .jpg |
Meine Frage ist, wie mache ich jetzt weiter? Also wie baue ich das jetzt in mkisofs oder cp ein?
Vielen Dank für jede hilfreiche Antwort |
|
Back to top |
|
|
franzf Advocate
Joined: 29 Mar 2005 Posts: 4565
|
Posted: Thu Nov 13, 2008 11:50 am Post subject: |
|
|
Code: | ISO_FILES=$(locate heinz | grep 2008 | grep .jpg) |
speichert dir das Ergebnis in der Variable $ISO_FILES.
Die solltest du jetzt einfach an mkisofs weiterreichen können. |
|
Back to top |
|
|
disi Veteran
Joined: 28 Nov 2003 Posts: 1354 Location: Out There ...
|
Posted: Thu Nov 13, 2008 11:51 am Post subject: |
|
|
Also mit find kannst du so etwas machen:
Code: | find /whatever -type f -name "^heinz*.jpg" -exec cp {} /wherever |
Wobei ich kein Freak fuer Regular Expression bin _________________ Gentoo on Uptime Project - Larry is a cow |
|
Back to top |
|
|
hitachi Guru
Joined: 20 Feb 2006 Posts: 478 Location: Freiburg / Deutschland
|
Posted: Thu Nov 13, 2008 12:31 pm Post subject: |
|
|
@ franzf: Danke. Das Funktioniert (wenn die Variable nicht leer ist). |
|
Back to top |
|
|
schachti Advocate
Joined: 28 Jul 2003 Posts: 3765 Location: Gifhorn, Germany
|
Posted: Thu Nov 13, 2008 1:43 pm Post subject: Re: Frage zu pipe |
|
|
hitachi wrote: | Code: | locate heinz | grep 2008 | grep .jpg |
Meine Frage ist, wie mache ich jetzt weiter? Also wie baue ich das jetzt in mkisofs oder cp ein?
|
Code: |
cp `locate heinz | grep 2008 | grep .jpg` ZIELVERZEICHNIS
|
_________________ Never argue with an idiot. He brings you down to his level, then beats you with experience.
How-To: Daten verschlüsselt auf DVD speichern. |
|
Back to top |
|
|
|