From unknown Wed Jun 18 00:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9950: rm -r partial failure Resent-From: Graham Lawrence Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Nov 2011 16:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9950 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 9950@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.132042355823657 (code B ref -1); Fri, 04 Nov 2011 16:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 4 Nov 2011 16:19:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMMU9-00069T-Vq for submit@debbugs.gnu.org; Fri, 04 Nov 2011 12:19:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMLAv-0004F1-2I for submit@debbugs.gnu.org; Fri, 04 Nov 2011 10:55:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RML8O-0003K5-Ta for submit@debbugs.gnu.org; Fri, 04 Nov 2011 10:52:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:57822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RML8O-0003Jz-S6 for submit@debbugs.gnu.org; Fri, 04 Nov 2011 10:52:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RML8O-0002ZL-12 for bug-coreutils@gnu.org; Fri, 04 Nov 2011 10:52:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RML8L-0003Id-VO for bug-coreutils@gnu.org; Fri, 04 Nov 2011 10:52:43 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:50667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RML8L-0003IM-Pq for bug-coreutils@gnu.org; Fri, 04 Nov 2011 10:52:41 -0400 Received: by pzk6 with SMTP id 6so5191302pzk.6 for ; Fri, 04 Nov 2011 07:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=S9zTtpkcfGaKqT9GlKCztyHY9XigEKSOAZTr/5jgy44=; b=FAWVnk2UWJz0SLyHJkhbLKfFlj/sd7DLTfJl7Jj25BTeJgdIF9vrWgO0yoE9CzYDCb ESNEKnkZGESl0hOSq/ISn+vtdQ7QMdkTkJti29Wggl5E6kH3H5fwcshSmpEseINIohtZ auDS207Adc6yf4wvUv7ZJo9N4FoRGkMu4RmKg= MIME-Version: 1.0 Received: by 10.50.135.40 with SMTP id pp8mr12516962igb.1.1320418360303; Fri, 04 Nov 2011 07:52:40 -0700 (PDT) Received: by 10.231.134.135 with HTTP; Fri, 4 Nov 2011 07:52:40 -0700 (PDT) Date: Fri, 4 Nov 2011 07:52:40 -0700 Message-ID: From: Graham Lawrence Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Fri, 04 Nov 2011 12:19:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) By my understanding of rm -r the files listed by find below should have been removed by the first rm. But it took only some of them. Vim was not running during this process. ~ $pwd /home/g ~ $find /home -name *swp /home/g/.vim/config.swp /home/g/.vim/Notes.swp /home/g/.vim/nzb.sh.swp /home/g/.vim/makesess.vim.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/.vim/.bashrc.swp /home/g/.vim/renamer.sh.swp /home/g/.vim/vimcht.swp /home/g/.vim/grepnotes.sh.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -rf *.swp ~ $find /home -name *swp /home/g/.vim/Notes.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -rf *swp ~ $find /home -name *swp /home/g/.vim/Notes.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -f /home/g/.vim/Notes.swp ~ $rm /home/g/.vim/backup.sh.swp ~ $rm /home/g/.vim/.vimrc.swp ~ $rm /home/g/Scripts/.reseq.awk.swp ~ $rm /home/g/.fluxbox/.menu.swp ~ $find /home -name *swp ~ $ From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 12:35:20 2011 Received: (at control) by debbugs.gnu.org; 4 Nov 2011 16:35:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMMjg-0006Wt-AC for submit@debbugs.gnu.org; Fri, 04 Nov 2011 12:35:20 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMMjd-0006Wg-C7; Fri, 04 Nov 2011 12:35:18 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 222D2211D1; Fri, 4 Nov 2011 10:32:41 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id CEDFD2DCC5; Fri, 4 Nov 2011 10:32:40 -0600 (MDT) Date: Fri, 4 Nov 2011 10:32:40 -0600 From: Bob Proulx To: Graham Lawrence Subject: Re: bug#9950: rm -r partial failure Message-ID: <20111104163240.GA9103@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: control Cc: 9950-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) tags 9950 + notabug thanks Graham Lawrence wrote: > By my understanding of rm -r the files listed by find below should > have been removed by the first rm. But it took only some of them. > Vim was not running during this process. Thank you for your bug report. However this is simply a misunderstanding of the shell file glob expansion of your shell and not a bug in rm. > ~ $pwd > /home/g You are in your home directory. > ~ $find /home -name *swp > /home/g/.vim/config.swp > /home/g/.vim/Notes.swp > /home/g/.vim/nzb.sh.swp > /home/g/.vim/makesess.vim.swp > /home/g/.vim/backup.sh.swp > /home/g/.vim/.vimrc.swp > /home/g/.vim/.bashrc.swp > /home/g/.vim/renamer.sh.swp > /home/g/.vim/vimcht.swp > /home/g/.vim/grepnotes.sh.swp > /home/g/Scripts/.reseq.awk.swp > /home/g/.fluxbox/.menu.swp There are twelve .swp files in subdirectories. There are none in the current directory. > ~ $rm -rf *.swp That will not match any files. No files will be deleted. You can verify that no files are matched by using the 'echo' command. I will assume 'bash' for the following examples. $ echo ls -ldog *.swp ls -ldog *.swp See? No files are matched by the "*.swp" file glob. The shell could not find any and so the option argument was left unchanged. If it had matched files then the actual files would have been replaced on that option argument. For example: $ touch file1.test $ echo ls -ldog *.test ls -ldog file1.test See how the file glob is replaced *by the shell* with the matching files. At this point your problem should be clear. The file glob is not matching any files and therefore rm isn't removing any. rm isn't complaining because the rm -f option tells it not to complain about files that do not exist. The string "*.swp" is a file that does not exist. > ~ $rm -f /home/g/.vim/Notes.swp > ~ $rm /home/g/.vim/backup.sh.swp > ~ $rm /home/g/.vim/.vimrc.swp > ~ $rm /home/g/Scripts/.reseq.awk.swp > ~ $rm /home/g/.fluxbox/.menu.swp > ~ $find /home -name *swp > ~ $ Right. Here you have told rm to remove the files individually. So of course that works. If you want to find files and then remove them you should use find. And you are *already* using find. So this should be natural. $ find /home -name '*.swp' -ls ...verify your file list... $ find /home -name '*.swp' -delete Using -delete is a new option. The traditional method would be to use the rm command with find. $ find /home -name '*.swp' -exec rm -f {} + Using find provides a powerful file finding mechanism that works with all of the rest of the utilities. It is a general solution. Please also see this reference for more information: http://www.gnu.org/software/coreutils/faq/#Why-doesn_0027t-rm-_002dr-_002a_002epattern-recurse-like-it-should_003f And also this one too: http://www.gnu.org/software/coreutils/faq/#Why-doesn_0027t-rm-_002dr-_002a_002epattern-recurse-like-it-should_003f Bob From unknown Wed Jun 18 00:29:30 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Graham Lawrence Subject: bug#9950: closed (Re: bug#9950: rm -r partial failure) Message-ID: References: <20111104163240.GA9103@hysteria.proulx.com> X-Gnu-PR-Message: they-closed 9950 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 9950@debbugs.gnu.org Date: Fri, 04 Nov 2011 16:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1320424562-25166-1" This is a multi-part message in MIME format... ------------=_1320424562-25166-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #9950: rm -r partial failure which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 9950@debbugs.gnu.org. --=20 9950: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D9950 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1320424562-25166-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 9950-done) by debbugs.gnu.org; 4 Nov 2011 16:35:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMMjg-0006Wr-1h for submit@debbugs.gnu.org; Fri, 04 Nov 2011 12:35:20 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMMjd-0006Wg-C7; Fri, 04 Nov 2011 12:35:18 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 222D2211D1; Fri, 4 Nov 2011 10:32:41 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id CEDFD2DCC5; Fri, 4 Nov 2011 10:32:40 -0600 (MDT) Date: Fri, 4 Nov 2011 10:32:40 -0600 From: Bob Proulx To: Graham Lawrence Subject: Re: bug#9950: rm -r partial failure Message-ID: <20111104163240.GA9103@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 9950-done Cc: 9950-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) tags 9950 + notabug thanks Graham Lawrence wrote: > By my understanding of rm -r the files listed by find below should > have been removed by the first rm. But it took only some of them. > Vim was not running during this process. Thank you for your bug report. However this is simply a misunderstanding of the shell file glob expansion of your shell and not a bug in rm. > ~ $pwd > /home/g You are in your home directory. > ~ $find /home -name *swp > /home/g/.vim/config.swp > /home/g/.vim/Notes.swp > /home/g/.vim/nzb.sh.swp > /home/g/.vim/makesess.vim.swp > /home/g/.vim/backup.sh.swp > /home/g/.vim/.vimrc.swp > /home/g/.vim/.bashrc.swp > /home/g/.vim/renamer.sh.swp > /home/g/.vim/vimcht.swp > /home/g/.vim/grepnotes.sh.swp > /home/g/Scripts/.reseq.awk.swp > /home/g/.fluxbox/.menu.swp There are twelve .swp files in subdirectories. There are none in the current directory. > ~ $rm -rf *.swp That will not match any files. No files will be deleted. You can verify that no files are matched by using the 'echo' command. I will assume 'bash' for the following examples. $ echo ls -ldog *.swp ls -ldog *.swp See? No files are matched by the "*.swp" file glob. The shell could not find any and so the option argument was left unchanged. If it had matched files then the actual files would have been replaced on that option argument. For example: $ touch file1.test $ echo ls -ldog *.test ls -ldog file1.test See how the file glob is replaced *by the shell* with the matching files. At this point your problem should be clear. The file glob is not matching any files and therefore rm isn't removing any. rm isn't complaining because the rm -f option tells it not to complain about files that do not exist. The string "*.swp" is a file that does not exist. > ~ $rm -f /home/g/.vim/Notes.swp > ~ $rm /home/g/.vim/backup.sh.swp > ~ $rm /home/g/.vim/.vimrc.swp > ~ $rm /home/g/Scripts/.reseq.awk.swp > ~ $rm /home/g/.fluxbox/.menu.swp > ~ $find /home -name *swp > ~ $ Right. Here you have told rm to remove the files individually. So of course that works. If you want to find files and then remove them you should use find. And you are *already* using find. So this should be natural. $ find /home -name '*.swp' -ls ...verify your file list... $ find /home -name '*.swp' -delete Using -delete is a new option. The traditional method would be to use the rm command with find. $ find /home -name '*.swp' -exec rm -f {} + Using find provides a powerful file finding mechanism that works with all of the rest of the utilities. It is a general solution. Please also see this reference for more information: http://www.gnu.org/software/coreutils/faq/#Why-doesn_0027t-rm-_002dr-_002a_002epattern-recurse-like-it-should_003f And also this one too: http://www.gnu.org/software/coreutils/faq/#Why-doesn_0027t-rm-_002dr-_002a_002epattern-recurse-like-it-should_003f Bob ------------=_1320424562-25166-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Nov 2011 16:19:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMMU9-00069T-Vq for submit@debbugs.gnu.org; Fri, 04 Nov 2011 12:19:18 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMLAv-0004F1-2I for submit@debbugs.gnu.org; Fri, 04 Nov 2011 10:55:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RML8O-0003K5-Ta for submit@debbugs.gnu.org; Fri, 04 Nov 2011 10:52:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:57822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RML8O-0003Jz-S6 for submit@debbugs.gnu.org; Fri, 04 Nov 2011 10:52:44 -0400 Received: from eggs.gnu.org ([140.186.70.92]:44479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RML8O-0002ZL-12 for bug-coreutils@gnu.org; Fri, 04 Nov 2011 10:52:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RML8L-0003Id-VO for bug-coreutils@gnu.org; Fri, 04 Nov 2011 10:52:43 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:50667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RML8L-0003IM-Pq for bug-coreutils@gnu.org; Fri, 04 Nov 2011 10:52:41 -0400 Received: by pzk6 with SMTP id 6so5191302pzk.6 for ; Fri, 04 Nov 2011 07:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=S9zTtpkcfGaKqT9GlKCztyHY9XigEKSOAZTr/5jgy44=; b=FAWVnk2UWJz0SLyHJkhbLKfFlj/sd7DLTfJl7Jj25BTeJgdIF9vrWgO0yoE9CzYDCb ESNEKnkZGESl0hOSq/ISn+vtdQ7QMdkTkJti29Wggl5E6kH3H5fwcshSmpEseINIohtZ auDS207Adc6yf4wvUv7ZJo9N4FoRGkMu4RmKg= MIME-Version: 1.0 Received: by 10.50.135.40 with SMTP id pp8mr12516962igb.1.1320418360303; Fri, 04 Nov 2011 07:52:40 -0700 (PDT) Received: by 10.231.134.135 with HTTP; Fri, 4 Nov 2011 07:52:40 -0700 (PDT) Date: Fri, 4 Nov 2011 07:52:40 -0700 Message-ID: Subject: rm -r partial failure From: Graham Lawrence To: bug-coreutils@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 04 Nov 2011 12:19:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) By my understanding of rm -r the files listed by find below should have been removed by the first rm. But it took only some of them. Vim was not running during this process. ~ $pwd /home/g ~ $find /home -name *swp /home/g/.vim/config.swp /home/g/.vim/Notes.swp /home/g/.vim/nzb.sh.swp /home/g/.vim/makesess.vim.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/.vim/.bashrc.swp /home/g/.vim/renamer.sh.swp /home/g/.vim/vimcht.swp /home/g/.vim/grepnotes.sh.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -rf *.swp ~ $find /home -name *swp /home/g/.vim/Notes.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -rf *swp ~ $find /home -name *swp /home/g/.vim/Notes.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -f /home/g/.vim/Notes.swp ~ $rm /home/g/.vim/backup.sh.swp ~ $rm /home/g/.vim/.vimrc.swp ~ $rm /home/g/Scripts/.reseq.awk.swp ~ $rm /home/g/.fluxbox/.menu.swp ~ $find /home -name *swp ~ $ ------------=_1320424562-25166-1-- From unknown Wed Jun 18 00:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9950: closed (Re: bug#9950: rm -r partial failure) References: In-Reply-To: Resent-From: Graham Lawrence Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Nov 2011 19:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9950 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: 9950@debbugs.gnu.org Received: via spool by 9950-submit@debbugs.gnu.org id=B9950.132043546011571 (code B ref 9950); Fri, 04 Nov 2011 19:38:01 +0000 Received: (at 9950) by debbugs.gnu.org; 4 Nov 2011 19:37:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMPa7-00030Z-0f for submit@debbugs.gnu.org; Fri, 04 Nov 2011 15:37:39 -0400 Received: from mail-iy0-f172.google.com ([209.85.210.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMPa4-00030S-UK for 9950@debbugs.gnu.org; Fri, 04 Nov 2011 15:37:37 -0400 Received: by iaeo4 with SMTP id o4so2971309iae.3 for <9950@debbugs.gnu.org>; Fri, 04 Nov 2011 12:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=7tQc1j7DgT6+UeJATK/zXBOTI9NKvZ99NlD4sdoyaJ0=; b=GNztjOJsxpvXoq1rQg0/w+FRL19R4tLvZTstmgacxz81OCqd41wNk6dQEqSgnPAbJr hGDNm/DLw/pdnu9sAFROcGDU5W7+G9u9HEJVuFUr8JQheAk7BqeDsJ9gr/SHKUoPV2F0 X+hJB5M0bdJxCeP4K/aFKgPK5fgJgM4kpjcgw= MIME-Version: 1.0 Received: by 10.231.45.135 with SMTP id e7mr4228508ibf.12.1320435300061; Fri, 04 Nov 2011 12:35:00 -0700 (PDT) Received: by 10.231.134.135 with HTTP; Fri, 4 Nov 2011 12:35:00 -0700 (PDT) Date: Fri, 4 Nov 2011 12:35:00 -0700 Message-ID: From: Graham Lawrence Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -4.8 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) I appreciate the detailed response from Bob Proulx, but I do not think it addressed the question I raised. I had expected "rm -rf *.swp" to remove all the files listed by find, Mr Proulx informed me that it would have removed none of them, but in fact what it did was remove SOME of them. ~ $find /home -name *swp ................the original list delivered by find /home/g/.vim/config.swp /home/g/.vim/Notes.swp /home/g/.vim/nzb.sh.swp /home/g/.vim/makesess.vim.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/.vim/.bashrc.swp /home/g/.vim/renamer.sh.swp /home/g/.vim/vimcht.swp /home/g/.vim/grepnotes.sh.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -rf *.swp ...............................the doubtful rm command ~ $find /home -name *swp ..............the same find command, showing some deleted, and some not /home/g/.vim/Notes.swp /home/g/.vim/backup.sh.swp /home/g/.vim/.vimrc.swp /home/g/Scripts/.reseq.awk.swp /home/g/.fluxbox/.menu.swp ~ $rm -rf *swp For example, why did it remove /home/g/.vim/renamer.sh.swp but ignore /home/g/.vim/backup.sh.swp From unknown Wed Jun 18 00:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9950: closed (Re: bug#9950: rm -r partial failure) Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Nov 2011 20:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9950 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Graham Lawrence Cc: 9950@debbugs.gnu.org Received: via spool by 9950-submit@debbugs.gnu.org id=B9950.132043856318877 (code B ref 9950); Fri, 04 Nov 2011 20:30:02 +0000 Received: (at 9950) by debbugs.gnu.org; 4 Nov 2011 20:29:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMQOB-0004uQ-2q for submit@debbugs.gnu.org; Fri, 04 Nov 2011 16:29:23 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMQO8-0004uI-Hy for 9950@debbugs.gnu.org; Fri, 04 Nov 2011 16:29:21 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 546F8211D1; Fri, 4 Nov 2011 14:26:43 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 18E042DCC5; Fri, 4 Nov 2011 14:26:43 -0600 (MDT) Date: Fri, 4 Nov 2011 14:26:43 -0600 From: Bob Proulx Message-ID: <20111104202643.GA18091@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Graham Lawrence wrote: > I appreciate the detailed response from Bob Proulx, but I do not think > it addressed the question I raised. Please keep the discussion going until we have reached consensus. > I had expected "rm -rf *.swp" to remove all the files listed by > find, Mr Proulx informed me that it would have removed none of them, Not given the information discussed so far. :-) > but in fact what it did was remove SOME of them. What? That is very unexpected behavior! Please show us the result of these commands: echo *.swp ls -ldog *.swp What shell are you using? echo $0 echo $SHELL If that happens to turn out to be /bin/sh then please follow up by figuring out if /bin/sh is a symlink to a different shell. And if it isn't a symlink try to find out what shell it is really. ls -ldog /bin/sh Expansion of the '*.swp' is a function of your shell. So finding that information is critical to understanding the behavior. I am using bash. If you are using a different shell then the behavior could be quite different. But it would still be a function of the shell. What filesystem are you operating upon? Is it a local filesystem or a network mounted filesystem such as NFS or Samba? 'find' can print this information. find . -name '*.swp' -printf '%F %p\n' > For example, why did it remove > /home/g/.vim/renamer.sh.swp > but ignore > /home/g/.vim/backup.sh.swp I am unable to reproduce your results. I used the following setup actions to recreate your test case: mkdir g mkdir g/.vim touch g/.vim/config.swp touch g/.vim/Notes.swp touch g/.vim/nzb.sh.swp touch g/.vim/makesess.vim.swp touch g/.vim/backup.sh.swp touch g/.vim/.vimrc.swp touch g/.vim/.bashrc.swp touch g/.vim/renamer.sh.swp touch g/.vim/vimcht.swp touch g/.vim/grepnotes.sh.swp mkdir g/Scripts touch g/Scripts/.reseq.awk.swp mkdir g/.fluxbox touch g/.fluxbox/.menu.swp $ cd g $ find . -name '*.swp' ./.vim/.vimrc.swp ./.vim/vimcht.swp ./.vim/nzb.sh.swp ./.vim/Notes.swp ./.vim/config.swp ./.vim/makesess.vim.swp ./.vim/renamer.sh.swp ./.vim/backup.sh.swp ./.vim/.bashrc.swp ./.vim/grepnotes.sh.swp ./Scripts/.reseq.awk.swp ./.fluxbox/.menu.swp $ find . -name '*.swp' | wc -l 12 $ echo *.swp *.swp $ ls -ldog *.swp ls: cannot access *.swp: No such file or directory $ rm -rf *.swp $ find . -name '*.swp' | wc -l 12 Bob From unknown Wed Jun 18 00:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9950: closed (Re: bug#9950: rm -r partial failure) Resent-From: Graham Lawrence Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Nov 2011 23:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9950 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Bob Proulx Cc: 9950@debbugs.gnu.org Received: via spool by 9950-submit@debbugs.gnu.org id=B9950.13204495775350 (code B ref 9950); Fri, 04 Nov 2011 23:33:01 +0000 Received: (at 9950) by debbugs.gnu.org; 4 Nov 2011 23:32:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMTFn-0001OE-To for submit@debbugs.gnu.org; Fri, 04 Nov 2011 19:32:56 -0400 Received: from mail-qy0-f172.google.com ([209.85.216.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMTFk-0001O5-QA for 9950@debbugs.gnu.org; Fri, 04 Nov 2011 19:32:53 -0400 Received: by qyl16 with SMTP id 16so1485396qyl.3 for <9950@debbugs.gnu.org>; Fri, 04 Nov 2011 16:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=e+udNcRlWD4SdPSkiUBVk5deIezKGuNDL0LV6/pYlCQ=; b=WdwFmmEBv49aJF7LbyBq83zYt1gA6ohc/bj3MzX5Zh5CEsfiIZz/KJ6n1suOK2JRDN BXLPTJvwvVNNEBzEo5vPHv6nn6Kw+qiLshE39GIztrF9mbgPnjhOUcATlYn5tv2NJl5e RjZkkNb/IfIQZ6wxhk3xSkkjeiOrT2/zewntI= MIME-Version: 1.0 Received: by 10.50.135.40 with SMTP id pp8mr15764613igb.1.1320449415097; Fri, 04 Nov 2011 16:30:15 -0700 (PDT) Received: by 10.231.134.135 with HTTP; Fri, 4 Nov 2011 16:30:15 -0700 (PDT) In-Reply-To: <20111104202643.GA18091@hysteria.proulx.com> References: <20111104202643.GA18091@hysteria.proulx.com> Date: Fri, 4 Nov 2011 16:30:15 -0700 Message-ID: From: Graham Lawrence Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) The system is stock slackware 13.37 on my vanilla home desktop pc, of which I am the sole user. Here is the data you requested. With this new set of swp files behavior is exactly as you said it should be. Is there any way I can recover the original set of swp files that I removed, or is rm for keeps? ~ $echo *.swp *.swp ~ $ls -ldog *.swp ls: cannot access *.swp: No such file or directory ~ $echo $0 bash ~ $echo $SHELL /bin/bash ~ $ls -ldog /bin/sh lrwxrwxrwx 1 4 Oct 22 04:56 /bin/sh -> bash ~ $find . -name '*.swp' -printf '%F %p\n' ext4 ./.vim/config.swp ext4 ./.vim/music.sh.swp ext4 ./.vim/freedom.swp ext4 ./.vim/Notes.swp ext4 ./.vim/nzb.sh.swp ext4 ./.vim/makesess.vim.swp ext4 ./.vim/.vimrc.swp ext4 ./.vim/.bashrc.swp ext4 ./.vim/renamer.sh.swp ext4 ./.vim/vimcht.swp ext4 ./.vim/grepnotes.sh.swp ~ $find . -name '*.swp' | wc -l 11 ~ $echo *.swp *.swp ~ $ls -ldog *.swp ls: cannot access *.swp: No such file or directory ~ $rm -rf *.swp ~ $find . -name '*.swp' | wc -l 11 ~ $find /home -name *swp /home/g/.vim/config.swp /home/g/.vim/music.sh.swp /home/g/.vim/freedom.swp /home/g/.vim/Notes.swp /home/g/.vim/nzb.sh.swp /home/g/.vim/makesess.vim.swp /home/g/.vim/.vimrc.swp /home/g/.vim/.bashrc.swp /home/g/.vim/renamer.sh.swp /home/g/.vim/vimcht.swp /home/g/.vim/grepnotes.sh.swp ~ $rm -rf *.swp ~ $find /home -name *swp /home/g/.vim/config.swp /home/g/.vim/music.sh.swp /home/g/.vim/freedom.swp /home/g/.vim/Notes.swp /home/g/.vim/nzb.sh.swp /home/g/.vim/makesess.vim.swp /home/g/.vim/.vimrc.swp /home/g/.vim/.bashrc.swp /home/g/.vim/renamer.sh.swp /home/g/.vim/vimcht.swp /home/g/.vim/grepnotes.sh.swp ~ $ On Fri, Nov 4, 2011 at 1:26 PM, Bob Proulx wrote: > Graham Lawrence wrote: >> I appreciate the detailed response from Bob Proulx, but I do not think >> it addressed the question I raised. > > Please keep the discussion going until we have reached consensus. > >> I had expected "rm -rf *.swp" to remove all the files listed by >> find, Mr Proulx informed me that it would have removed none of them, > > Not given the information discussed so far. :-) > >> but in fact what it did was remove SOME of them. > > What? =A0That is very unexpected behavior! =A0Please show us the result o= f > these commands: > > =A0echo *.swp > > =A0ls -ldog *.swp > > What shell are you using? > > =A0echo $0 > > =A0echo $SHELL > > If that happens to turn out to be /bin/sh then please follow up by > figuring out if /bin/sh is a symlink to a different shell. =A0And if it > isn't a symlink try to find out what shell it is really. > > =A0ls -ldog /bin/sh > > Expansion of the '*.swp' is a function of your shell. =A0So finding that > information is critical to understanding the behavior. =A0I am using > bash. =A0If you are using a different shell then the behavior could be > quite different. =A0But it would still be a function of the shell. > > What filesystem are you operating upon? =A0Is it a local filesystem or > a network mounted filesystem such as NFS or Samba? =A0'find' can print > this information. > > =A0find . -name '*.swp' -printf '%F %p\n' > >> For example, why did it remove >> /home/g/.vim/renamer.sh.swp >> but ignore >> /home/g/.vim/backup.sh.swp > > I am unable to reproduce your results. =A0I used the following setup > actions to recreate your test case: > > =A0mkdir g > =A0mkdir g/.vim > =A0touch g/.vim/config.swp > =A0touch g/.vim/Notes.swp > =A0touch g/.vim/nzb.sh.swp > =A0touch g/.vim/makesess.vim.swp > =A0touch g/.vim/backup.sh.swp > =A0touch g/.vim/.vimrc.swp > =A0touch g/.vim/.bashrc.swp > =A0touch g/.vim/renamer.sh.swp > =A0touch g/.vim/vimcht.swp > =A0touch g/.vim/grepnotes.sh.swp > =A0mkdir g/Scripts > =A0touch g/Scripts/.reseq.awk.swp > =A0mkdir g/.fluxbox > =A0touch g/.fluxbox/.menu.swp > > =A0$ cd g > > =A0$ find . -name '*.swp' > =A0./.vim/.vimrc.swp > =A0./.vim/vimcht.swp > =A0./.vim/nzb.sh.swp > =A0./.vim/Notes.swp > =A0./.vim/config.swp > =A0./.vim/makesess.vim.swp > =A0./.vim/renamer.sh.swp > =A0./.vim/backup.sh.swp > =A0./.vim/.bashrc.swp > =A0./.vim/grepnotes.sh.swp > =A0./Scripts/.reseq.awk.swp > =A0./.fluxbox/.menu.swp > > =A0$ find . -name '*.swp' | wc -l > =A012 > > =A0$ echo *.swp > =A0*.swp > > =A0$ ls -ldog *.swp > =A0ls: cannot access *.swp: No such file or directory > > =A0$ rm -rf *.swp > =A0$ find . -name '*.swp' | wc -l > =A012 > > Bob > From unknown Wed Jun 18 00:29:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9950: closed (Re: bug#9950: rm -r partial failure) Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 05 Nov 2011 06:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9950 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Graham Lawrence Cc: 9950@debbugs.gnu.org Received: via spool by 9950-submit@debbugs.gnu.org id=B9950.13204734828783 (code B ref 9950); Sat, 05 Nov 2011 06:12:01 +0000 Received: (at 9950) by debbugs.gnu.org; 5 Nov 2011 06:11:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMZTN-0002Hb-HU for submit@debbugs.gnu.org; Sat, 05 Nov 2011 02:11:22 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RMZTK-0002HT-Nb for 9950@debbugs.gnu.org; Sat, 05 Nov 2011 02:11:19 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 5A5B6211D1; Sat, 5 Nov 2011 00:08:39 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 2B8272DCC5; Sat, 5 Nov 2011 00:08:39 -0600 (MDT) Date: Sat, 5 Nov 2011 00:08:39 -0600 From: Bob Proulx Message-ID: <20111105060839.GA5457@hysteria.proulx.com> References: <20111104202643.GA18091@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) > The system is stock slackware 13.37 on my vanilla home desktop pc, of > which I am the sole user. Should be okay. I was worried that it was some cross compiled program on a system that was not unix-like. > Here is the data you requested. ext4 seems reasonable. I was worried it was some strange network filesystem and so had unusual behavior. > With this new set of swp files behavior is exactly as you said it > should be. Good! :-) > Is there any way I can recover the original set of swp files that I > removed, or is rm for keeps? Not usually. Especially on journaled filesystems the data is reclaimed quickly. > ~ $echo *.swp > *.swp No matches. > ~ $ls -ldog *.swp > ls: cannot access *.swp: No such file or directory No files matched. So if you were using 'rm *.swp' then rm wouldn't have any files to remove either. > ~ $echo $0 > bash Bash should behave normally. Was worried that it was some other different shell that had interesting behavior. zsh for example can have some interesting behavior if given **/*.swp. > ~ $ls -ldog /bin/sh > lrwxrwxrwx 1 4 Oct 22 04:56 /bin/sh -> bash I was only concerned about /bin/sh if $0 happened to be /bin/sh. Since it is bash then we can stop there. I really think that now that you know what is going on that you won't be able to recreate any test cases where 'rm -rf *.swp' removes any files that are not in the current directory. Bob