Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Frage zu pipe
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
hitachi
Guru
Guru


Joined: 20 Feb 2006
Posts: 478
Location: Freiburg / Deutschland

PostPosted: Thu Nov 13, 2008 11:26 am    Post subject: Frage zu pipe Reply with quote

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
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 4565

PostPosted: Thu Nov 13, 2008 11:50 am    Post subject: Reply with quote

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
View user's profile Send private message
disi
Veteran
Veteran


Joined: 28 Nov 2003
Posts: 1354
Location: Out There ...

PostPosted: Thu Nov 13, 2008 11:51 am    Post subject: Reply with quote

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 :oops:
_________________
Gentoo on Uptime Project - Larry is a cow
Back to top
View user's profile Send private message
hitachi
Guru
Guru


Joined: 20 Feb 2006
Posts: 478
Location: Freiburg / Deutschland

PostPosted: Thu Nov 13, 2008 12:31 pm    Post subject: Reply with quote

@ franzf: Danke. Das Funktioniert (wenn die Variable nicht leer ist).
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Thu Nov 13, 2008 1:43 pm    Post subject: Re: Frage zu pipe Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum