Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #11386
| Path | csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.ripco.com!news.glorb.com!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Linda Walsh <bash@tlinx.org> |
| Newsgroups | gnu.bash.bug |
| Subject | Re: -e does not take effects in subshell |
| Date | Tue, 18 Aug 2015 15:31:10 -0700 |
| Lines | 45 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.8585.1439937082.904.bug-bash@gnu.org> (permalink) |
| References | <BLU176-W28809FB59FF9274B34D871D67F0@phx.gbl> <20150811135056.GD4309@eeg.ccf.org> <BLU176-W27103575D91F4EF315336FD67D0@phx.gbl> <55CC26A7.10000@redhat.com> <55D39A71.2030109@tlinx.org> <87mvxo5mme.fsf@igel.home> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | usenet.stanford.edu 1439937082 28468 208.118.235.17 (18 Aug 2015 22:31:22 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | PRC <ijkxyz@msn.com>, Greg Wooledge <wooledg@eeg.ccf.org>, Eric Blake <eblake@redhat.com>, "bug-bash@gnu.org" <bug-bash@gnu.org> |
| To | Andreas Schwab <schwab@linux-m68k.org> |
| Envelope-to | bug-bash@gnu.org |
| User-Agent | Thunderbird |
| In-Reply-To | <87mvxo5mme.fsf@igel.home> |
| X-detected-operating-system | by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] |
| X-Received-From | 173.164.175.65 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.14 |
| Precedence | list |
| List-Id | Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe> |
| List-Archive | <http://lists.gnu.org/archive/html/bug-bash> |
| List-Post | <mailto:bug-bash@gnu.org> |
| List-Help | <mailto:bug-bash-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe> |
| Xref | csiph.com gnu.bash.bug:11386 |
Show key headers only | View raw
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