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 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: References: <20150811135056.GD4309@eeg.ccf.org> <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 , Greg Wooledge , Eric Blake , "bug-bash@gnu.org" To: Andreas Schwab 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11386 Andreas Schwab wrote: > Linda Walsh 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.