portdowngrade and meta ports

Chris Rees crees at FreeBSD.org
Fri May 25 16:52:36 UTC 2012


On 25 May 2012 14:09, RW <rwmaillists at googlemail.com> wrote:
> On Thu, 24 May 2012 22:43:08 +0100
> Chris Rees wrote:
>
>
>> For the archive-- just thought-- even though I did a typo there,
>> DON'T use:
>>
>> mv file file.bak && echo something > file
>>
>> at least with csh, file will be clobbered before mv gets to it....
>
> I tried that in bash and csh and it worked correctly in both.
>
> e.g. in csh:
>
>  %echo nothing > foo
>  %mv foo bar && echo something > foo
>  %cat foo
>  something
>  %cat bar
>  nothing
>
> If a shell supports short-circuiting then mv must complete before echo
> can start, so I don't see how it can fail unless the shell opens the
> file before it runs mv.
>
> Are you perhaps mixing this up with what happens with:
>
>  cat foo bar > foo

Perhaps.  Just being overcautious, sorry :)

Chris


More information about the freebsd-ports mailing list