Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2012 17:52:04 +0100
From:      Chris Rees <crees@FreeBSD.org>
To:        RW <rwmaillists@googlemail.com>
Cc:        ports@freebsd.org
Subject:   Re: portdowngrade and meta ports
Message-ID:  <CADLo83-G7P8aVHJ0CzajO4p1VVJdYxBvgS4f-QO-m0Jg6eFQ_w@mail.gmail.com>
In-Reply-To: <20120525140958.65863f97@gumby.homeunix.com>
References:  <alpine.BSF.2.00.1205241335190.22032@abbf.ynefrvtuareubzr.pbz> <CADLo838ER8kAS276HTyEBFsW=UmjbcBKMrAjfzyJ%2B=JZt-F%2BtA@mail.gmail.com> <CADLo83_qqGmqkQR54DKa=RemB01zGniREowMzTH7t7c2yzTO6w@mail.gmail.com> <20120525140958.65863f97@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 25 May 2012 14:09, RW <rwmaillists@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:
>
> =A0%echo nothing > foo
> =A0%mv foo bar && echo something > foo
> =A0%cat foo
> =A0something
> =A0%cat bar
> =A0nothing
>
> 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:
>
> =A0cat foo bar > foo

Perhaps.  Just being overcautious, sorry :)

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo83-G7P8aVHJ0CzajO4p1VVJdYxBvgS4f-QO-m0Jg6eFQ_w>