portdowngrade and meta ports
RW
rwmaillists at googlemail.com
Fri May 25 13:10:04 UTC 2012
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
More information about the freebsd-ports
mailing list