Re: Redirections and noclobber
On Thu, Oct 07, 2004 at 10:18:09AM +0200, Frank Küster wrote:
> Bill Allombert <email@example.com> wrote:
> > On Wed, Oct 06, 2004 at 05:02:00PM +0200, Frank Küster wrote:
> >> but I
> >> see no reason, neither in Policy nor in "common sense", why root
> >> shouldn't use it. On the other hand, this usage of mktemp has been
> >> the result of discussions on firstname.lastname@example.org, and I'm quite
> >> sure to have seen it elsewhere.
> > In my opinion, noclobber should only be set for interactive shell, or
> > explicitely in a shell-script. The same for most others shell options.
> But if I start apt-get upgrade or whatever from my interactive shell
> with noclobber set, all childs will inherit it. That's how the problem
> came up.
How ? noclobber is not part of the environment so is not carried out
by fork() and shells launched by dpkg should not be interative.
bash-2.05a$ set -C
bash-2.05a$ echo a >bar
bash-2.05a$ echo b >bar
bash: bar: cannot overwrite existing file
bash-2.05a$ cat test.sh
echo a >foo
echo b >foo
So I am really interested to know what happens here.
Imagine a large red swirl here.