Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #11386
| From | Linda Walsh <bash@tlinx.org> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: -e does not take effects in subshell |
| Date | 2015-08-18 15:31 -0700 |
| Message-ID | <mailman.8585.1439937082.904.bug-bash@gnu.org> (permalink) |
| References | (1 earlier) <20150811135056.GD4309@eeg.ccf.org> <BLU176-W27103575D91F4EF315336FD67D0@phx.gbl> <55CC26A7.10000@redhat.com> <55D39A71.2030109@tlinx.org> <87mvxo5mme.fsf@igel.home> |
Andreas Schwab wrote:
> Linda Walsh <bash@tlinx.org> writes:
>
>> Ex: rmx -fr (alias to rm --one-file-system -fr, since rm lacks the
>> -x switch like 'find, cp, mv, et al.) no longer works to clean
>> out a directory && stay on *one* file system.
>>
>> Now rm will delete things on any number of file systems, as long
>> as they correspond to a cmdline argument.
>
> That's the only sensible way to implement it. Which, incidentally,
> works exactly like find -xdev.
---
with 'find', you can specify -xdev with a starting path of "."
with 'rm' functionality to remove '/' '.' and '..' was prohibited
by POSIX, though the coreutils version still allows the choice
of the more dangerous removal of '/' with with the --[no-]preserve-root.
But the more useful "rm -fr ." or the variant "rm -fr dir/." so you
know you are removing the contents of "dir", no matter where or what
"dir" is... with find, that doesn't work -- if 'dir' is a symlink
to /tmp/dir/.., find won't remove anything. Any other solution
from POSIX added complication. I was told by a BSD fanatic that 'rm'
was changed because after the SysV companies left POSIX (as most of
them had disappeared), BSD'ers gained a majority and could redirect
the standard as they pleased. Disallowing students playing around with
"rm -fr {/,dir/,}{.,..}" apparently was a big thing @Berkeley. Being
able to force the removal of such options from everyone's "rm" was
an huge win, they considered (this is from a discussion w/one fanatic,
but boy, was it memorable). Disallowing any option or ENV(POSIX_CORRECTLY)
option to "re-allow" the feature has been continuously shot down by
'rm' maintainers (even though they keep in their own alias-able switches
to all removal of '/').
> Now please explain what this has anything to do with POSIX.
It apparently was the POSIX 2008 standard that prohibited the historical
behavior (on linux -- removed dir contents, and failed on current-dir
because it made no sense -- but did so *quietly* and after following
the depth first design.
Back to gnu.bash.bug | Previous | Next | Find similar
Re: -e does not take effects in subshell Linda Walsh <bash@tlinx.org> - 2015-08-18 15:31 -0700
csiph-web