Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Copying certain subdirectories retaining structure



Philippe Troin <phil@xxxxxxxx> wrote in 
news:1393105212.21091.2.camel@xxxxxxxxxxxxxxxxx:


> 
> for i in **/good(/)
> do
>   dest=/media/usbkey/$i
>   mkdir -p $i:h
>   cp -a $i /media/usbkey/$i
> done
> 
> Phil.
Looks good . the clever bit is the mkdir -p $i:h



-- 
zzapper
https://twitter.com/dailyzshtip

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com




Messages sorted by: Reverse Date, Date, Thread, Author