* replace all versions of a file in hierachy with a more recent version
@ 2006-06-16 12:41 zzapper
2006-06-16 12:49 ` Peter Stephenson
0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2006-06-16 12:41 UTC (permalink / raw)
To: zsh-users
Hi
Feeling dim today, so this is probably trivial
I want to replace all versions of a file in hierachy with a more recent
version
--
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: replace all versions of a file in hierachy with a more recent version
2006-06-16 12:41 replace all versions of a file in hierachy with a more recent version zzapper
@ 2006-06-16 12:49 ` Peter Stephenson
2006-06-16 13:21 ` zzapper
0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2006-06-16 12:49 UTC (permalink / raw)
To: zsh-users
zzapper wrote:
> I want to replace all versions of a file in hierachy with a more recent
> version
Depending on what the criterion is for files that need replacing,
for f in oldlocation/**/*(.); do
cp newlocation${f##oldlocation} $f
done
pws
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: replace all versions of a file in hierachy with a more recent version
2006-06-16 12:49 ` Peter Stephenson
@ 2006-06-16 13:21 ` zzapper
2006-06-16 15:57 ` zzapper
0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2006-06-16 13:21 UTC (permalink / raw)
To: zsh-users
Peter Stephenson <pws@csr.com> wrote in
news:200606161249.k5GCnXdp009969@news01.csr.com:
> zzapper wrote:
>> I want to replace all versions of a file in hierachy with a more
>> recent version
>
> Depending on what the criterion is for files that need replacing,
>
> for f in oldlocation/**/*(.); do
> cp newlocation${f##oldlocation} $f
> done
>
> pws
>
PWS,
Wouldn't a find be better?
> To access the latest news from CSR copy this link into a web browser:
> http://www.csr.com/email_sig.php
>
--
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: replace all versions of a file in hierachy with a more recent version
2006-06-16 13:21 ` zzapper
@ 2006-06-16 15:57 ` zzapper
2006-06-16 16:24 ` sand
0 siblings, 1 reply; 6+ messages in thread
From: zzapper @ 2006-06-16 15:57 UTC (permalink / raw)
To: zsh-users
zzapper <david@tvis.co.uk> wrote in news:Xns97E4921DAEECEzzappergmailcom@
80.91.229.5:
> Peter Stephenson <pws@csr.com> wrote in
> news:200606161249.k5GCnXdp009969@news01.csr.com:
>
find . -name SQLyogTunnel.php -exec \cp c:/aaa/replace/SQLyogTunnel.php {}
\;
--
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: replace all versions of a file in hierachy with a more recent version
2006-06-16 15:57 ` zzapper
@ 2006-06-16 16:24 ` sand
2006-06-16 18:29 ` zzapper
0 siblings, 1 reply; 6+ messages in thread
From: sand @ 2006-06-16 16:24 UTC (permalink / raw)
To: zsh-users
zzapper wrote:
> find . -name SQLyogTunnel.php -exec \cp c:/aaa/replace/SQLyogTunnel.php {}
> \;
You can still do it without find:
for f in **/SQLyogTunnel.php; do
cp c:/aaa/replace/SQLyogTunnel.php $f
done
(I don't know how paths are handled under windows...)
sand
--
Hi, I'm a .signature virus! Copy me to your .signature file and
help me propagate, thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: replace all versions of a file in hierachy with a more recent version
2006-06-16 16:24 ` sand
@ 2006-06-16 18:29 ` zzapper
0 siblings, 0 replies; 6+ messages in thread
From: zzapper @ 2006-06-16 18:29 UTC (permalink / raw)
To: zsh-users
sand <sandman@freaknet.org> wrote in news:4492DB33.9030901@freaknet.org:
> zzapper wrote:
>> find . -name SQLyogTunnel.php -exec \cp
>> c:/aaa/replace/SQLyogTunnel.php {} \;
>
> You can still do it without find:
>
> for f in **/SQLyogTunnel.php; do
> cp c:/aaa/replace/SQLyogTunnel.php $f
> done
>
sand
Yep like that! (i'm actually using cygwin)
--
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-06-16 18:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-16 12:41 replace all versions of a file in hierachy with a more recent version zzapper
2006-06-16 12:49 ` Peter Stephenson
2006-06-16 13:21 ` zzapper
2006-06-16 15:57 ` zzapper
2006-06-16 16:24 ` sand
2006-06-16 18:29 ` zzapper
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).