From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 23:55:48 2010 Received: (at submit) by debbugs.gnu.org; 5 May 2010 03:55:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9Vi7-0006nd-Um for submit@debbugs.gnu.org; Tue, 04 May 2010 23:55:48 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9VKB-0006eL-F2 for submit@debbugs.gnu.org; Tue, 04 May 2010 23:31:04 -0400 Received: from lists.gnu.org ([199.232.76.165]:41969) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O9VK7-0005sL-T9 for submit@debbugs.gnu.org; Tue, 04 May 2010 23:30:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9VK7-00036R-AF for bug-coreutils@gnu.org; Tue, 04 May 2010 23:30:59 -0400 Received: from [140.186.70.92] (port=39194 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9VK4-0001zR-SD for bug-coreutils@gnu.org; Tue, 04 May 2010 23:30:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9Uz3-0008G3-Sg for bug-coreutils@gnu.org; Tue, 04 May 2010 23:09:15 -0400 Received: from vms173005pub.verizon.net ([206.46.173.5]:33487) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9Uz3-0008Fo-Nz for bug-coreutils@gnu.org; Tue, 04 May 2010 23:09:13 -0400 Received: from coyote.coyote.den ([unknown] [74.99.16.111]) by vms173005.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L1X00H87FF150P0@vms173005.mailsrvcs.net> for bug-coreutils@gnu.org; Tue, 04 May 2010 22:09:02 -0500 (CDT) Date: Tue, 04 May 2010 23:09:01 -0400 From: Gene Heskett Subject: Re: [Expert] Bug in mv? In-reply-to: <20100505024454.GA4003@huey> To: expert@mandrivalinux.org, bug-coreutils@gnu.org Message-id: <201005042309.01442.gene.heskett@gmail.com> Organization: Organization? very little MIME-version: 1.0 Content-type: Text/Plain; charset=iso-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE References: <201005042236.19730.gene.heskett@gmail.com> <20100505024454.GA4003@huey> User-Agent: KMail/1.12.4 (Linux/2.6.34-rc6; KDE/4.3.5; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (1203?) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 04 May 2010 23:55:46 -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: -4.6 (----) On Tuesday 04 May 2010, Jo=E3o Victor Martins wrote: >On Tue, May 04, 2010 at 10:36:19PM -0400, Gene Heskett wrote: >> I tried to "mv amanda* /home/amanda/*" as root and which >> which I recall I have done successfully several times before. > >The shell expand * _before_ passing the args to mv. So mv saw all >files starting with 'amanda' and all files (besides . hidden ones) i= n >/home/amanda/ as arg. It then picked the last one listed (probably >/home/amanda/tmp/) as destination. > I had two files whose names started with amanda in that directory. I= would=20 have assumed it would expand the src pattern of "amanda*" to match on= ly those=20 two files. And the rest of the files in /home/me, weren't bothered. = No=20 damages to the src directory at all other than removing the files. If it expanded that * to include the whole thing, it should have move= d the=20 whole thing. It didn't. In past experience, the target path spec's = /* has=20 always served as just a place holder for the filenames actually selec= ted by=20 the amanda* in the src spec. That is not what it did this time. Thi= s time=20 it created a tmp/ directory in /home/amanda, moved the whole amanda t= ree to=20 the tmp directory, including the two files I actually asked it to mov= e from=20 /home/me/Download. No loss, but a very surprised veteran linux user. Someplace, the plans of mice and men have definitely gone aglay here,= so I've=20 included bug-coreutils@gnu.org. --=20 Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Every nonzero finite dimensional inner product space has an orthonorm= al=20 basis. It makes sense, when you don't think about it. From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 17:03:12 2010 Received: (at 6104) by debbugs.gnu.org; 5 May 2010 21:03:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9lkO-0008OF-DF for submit@debbugs.gnu.org; Wed, 05 May 2010 17:03:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9lkM-0008OA-6N for 6104@debbugs.gnu.org; Wed, 05 May 2010 17:03:11 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o45L35Sn029290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 May 2010 17:03:05 -0400 Received: from [10.3.241.12] (vpn-241-12.phx2.redhat.com [10.3.241.12]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o45L336K019007; Wed, 5 May 2010 17:03:04 -0400 Message-ID: <4BE1DD00.2070601@redhat.com> Date: Wed, 05 May 2010 15:02:56 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Gene Heskett Subject: Re: bug#6104: [Expert] Bug in mv? References: <201005042236.19730.gene.heskett@gmail.com> <20100505024454.GA4003@huey> <201005042309.01442.gene.heskett@gmail.com> In-Reply-To: <201005042309.01442.gene.heskett@gmail.com> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig0DDEE641EA2FF1DA4FBC6C05" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-Spam-Score: -9.0 (---------) X-Debbugs-Envelope-To: 6104 Cc: 6104@debbugs.gnu.org, expert@mandrivalinux.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: -10.2 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig0DDEE641EA2FF1DA4FBC6C05 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/04/2010 09:09 PM, Gene Heskett wrote: > On Tuesday 04 May 2010, Jo=E3o Victor Martins wrote: >> On Tue, May 04, 2010 at 10:36:19PM -0400, Gene Heskett wrote: >>> I tried to "mv amanda* /home/amanda/*" as root and which >>> which I recall I have done successfully several times before. >> >> The shell expand * _before_ passing the args to mv. So mv saw all >> files starting with 'amanda' and all files (besides . hidden ones) in >> /home/amanda/ as arg. It then picked the last one listed (probably >> /home/amanda/tmp/) as destination. This analysis is correct. >> > I had two files whose names started with amanda in that directory. I w= ould=20 > have assumed it would expand the src pattern of "amanda*" to match only= those=20 > two files. And the rest of the files in /home/me, weren't bothered. N= o=20 > damages to the src directory at all other than removing the files. >=20 > If it expanded that * to include the whole thing, it should have moved = the=20 > whole thing. It didn't. In past experience, the target path spec's /*= has=20 > always served as just a place holder for the filenames actually selecte= d by=20 > the amanda* in the src spec. Huh? Globbing has never worked like that. Globbing is done by the shell, not by mv, so by the time mv is started, the * has already been converted into one or more filenames. Maybe you are thinking of the rename(1) or mmv(1) utility provided by some distros (but not part of coreutils), where, with proper quoting (so that the * goes through as argv of the rename command, which then does the pattern manipulation you wanted. But mv(1) is specified by POSIX, and has never done pattern manipulation. The glob in your second argument is expanded by the shell independently of the * in the first argument, and mv never knows that either variant was a glob. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig0DDEE641EA2FF1DA4FBC6C05 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJL4d0AAAoJEKeha0olJ0NqmpQIAIuSwOKOsYP/lSDyMIBn3wiD wZvlQs2MpYANv0uBt5i4igbgsAoffV1wv/Cp4Fz2zF1wsx9TUVXLXsRR2xe4lS4F qmctzULeGL4rfzCUvNju68RVg7MQ+dtQZLEs24Jo/Dg54AgK3W4mczOaXWu8ZaRX fb7i3Xyw75zuP+cDl0hJS2685Q4LyL/205eaBmaDb9/ALv7kP5pjuHCReJ6e/exK VgUeNoTn2PyNH02Kx5wqyig6PJWB7Pre6ihePmIeRoi0WuxSli9UfFMefFTp9/+v xVjJR28xzIza8MlG3obAoY57Vnh6WQRJd6zir1j5+UpSfU++v3V639Td8JwrylI= =Tj1N -----END PGP SIGNATURE----- --------------enig0DDEE641EA2FF1DA4FBC6C05-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 17:10:52 2010 Received: (at 6104) by debbugs.gnu.org; 5 May 2010 21:10:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9lrn-0008RX-LZ for submit@debbugs.gnu.org; Wed, 05 May 2010 17:10:51 -0400 Received: from c-98-226-122-10.hsd1.in.comcast.net ([98.226.122.10] helo=kosh.dhis.org) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O9lrm-0008RS-G1 for 6104@debbugs.gnu.org; Wed, 05 May 2010 17:10:50 -0400 Received: (qmail 29380 invoked by uid 1000); 5 May 2010 21:10:46 -0000 Message-ID: <20100505211046.29379.qmail@kosh.dhis.org> From: "Alan Curry" Subject: Re: bug#6104: [Expert] Bug in mv? To: gene.heskett@gmail.com (Gene Heskett) Date: Wed, 5 May 2010 16:10:46 -0500 (GMT+5) In-Reply-To: <201005042309.01442.gene.heskett@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Note: I saw this on bug-coreutils, haven't read the whole thread. Gene Heskett writes: > > On Tuesday 04 May 2010, Jo=E3o Victor Martins wrote: > >On Tue, May 04, 2010 at 10:36:19PM -0400, Gene Heskett wrote: > >> I tried to "mv amanda* /home/amanda/*" as root and which > >> which I recall I have done successfully several times before. > > > >The shell expand * _before_ passing the args to mv. So mv saw all > >files starting with 'amanda' and all files (besides . hidden ones) i= > n > >/home/amanda/ as arg. It then picked the last one listed (probably > >/home/amanda/tmp/) as destination. > > > I had two files whose names started with amanda in that directory. I > would > have assumed it would expand the src pattern of "amanda*" to match on > ly those [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.9 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address [98.226.122.10 listed in dnsbl.sorbs.net] 0.9 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [98.226.122.10 listed in zen.spamhaus.org] 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% [score: 0.5000] 0.1 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS -0.6 AWL AWL: From: address is in the auto white-list X-Debbugs-Envelope-To: 6104 Cc: 6104@debbugs.gnu.org, expert@mandrivalinux.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: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Note: I saw this on bug-coreutils, haven't read the whole thread. Gene Heskett writes: > > On Tuesday 04 May 2010, Jo=E3o Victor Martins wrote: > >On Tue, May 04, 2010 at 10:36:19PM -0400, Gene Heskett wrote: > >> I tried to "mv amanda* /home/amanda/*" as root and which > >> which I recall I have done successfully several times before. > > > >The shell expand * _before_ passing the args to mv. So mv saw all > >files starting with 'amanda' and all files (besides . hidden ones) i= > n > >/home/amanda/ as arg. It then picked the last one listed (probably > >/home/amanda/tmp/) as destination. > > > I had two files whose names started with amanda in that directory. I > would > have assumed it would expand the src pattern of "amanda*" to match on > ly those [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.9 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [98.226.122.10 listed in zen.spamhaus.org] 0.9 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address [98.226.122.10 listed in dnsbl.sorbs.net] 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% [score: 0.4998] 0.1 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS -0.6 AWL AWL: From: address is in the auto white-list Note: I saw this on bug-coreutils, haven't read the whole thread. Gene Heskett writes: > > On Tuesday 04 May 2010, Jo=E3o Victor Martins wrote: > >On Tue, May 04, 2010 at 10:36:19PM -0400, Gene Heskett wrote: > >> I tried to "mv amanda* /home/amanda/*" as root and which > >> which I recall I have done successfully several times before. > > > >The shell expand * _before_ passing the args to mv. So mv saw all > >files starting with 'amanda' and all files (besides . hidden ones) i= > n > >/home/amanda/ as arg. It then picked the last one listed (probably > >/home/amanda/tmp/) as destination. > > > I had two files whose names started with amanda in that directory. I > would > have assumed it would expand the src pattern of "amanda*" to match on > ly those It's not the first * that's the problem. The second one (/home/amanda/*) expands to a list of everything that was in /home/amanda (except dotfiles) and that happens before mv is executed. There are several possibilities of what that command can do: 1. /home/amanda contained no files before the move. In that case the /home/amanda/* is passed through literally as the final argument to mv, so mv sees 3 arguments (your 2 files, then "/home/amanda/*" which doesn't exist) and it fails, because with more than 2 arguments, the last argument must be an existing directory. 2. /home/amanda contained some stuff, and the last item in the expanded list (alphabetically sorted) was not a directory. Same result as #1. 3. /home/amanda contained some stuff, and the last item in the expanded list happened to be a directory (say you have a directory called /home/amanda/zzzzzzzz): then the list expands, the final argument to mv is an existing directory, so you have success! Your 2 files, plus everything in /home/amanda, gets moved into the zzzzzzzz directory. If this isn't what you meant, you did something wrong. mv just did what it was told. 4. Like #1, but with a nomatch shell option enabled, you get a "No match" error message. Your career as a unix wizard isn't complete until you've done something like #3 *on purpose*. -- Alan Curry From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 21:36:15 2010 Received: (at control) by debbugs.gnu.org; 6 May 2010 01:36:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9q0d-0003DF-72 for submit@debbugs.gnu.org; Wed, 05 May 2010 21:36:15 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9q0b-0003DA-J8 for control@debbugs.gnu.org; Wed, 05 May 2010 21:36:14 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id 85C3621363 for ; Wed, 5 May 2010 19:36:09 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id 7DB1F3CC3A0; Wed, 5 May 2010 19:36:09 -0600 (MDT) Date: Wed, 5 May 2010 19:36:09 -0600 From: Bob Proulx To: control@debbugs.gnu.org Subject: merge duplicates Message-ID: <20100506013609.GA9547@dementia.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: control 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 (--) forcemerge 6104 6118 thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 25 01:29:23 2011 Received: (at control) by debbugs.gnu.org; 25 Aug 2011 05: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 1QwSVH-0002oo-Ld for submit@debbugs.gnu.org; Thu, 25 Aug 2011 01:29:23 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QwSVF-0002og-0u for control@debbugs.gnu.org; Thu, 25 Aug 2011 01:29:21 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 6484321311 for ; Wed, 24 Aug 2011 23:26:43 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 40CAF49912; Wed, 24 Aug 2011 23:26:43 -0600 (MDT) Date: Wed, 24 Aug 2011 23:26:43 -0600 From: Bob Proulx To: control@debbugs.gnu.org Subject: Re: bug#6104: [Expert] Bug in mv? Message-ID: <20110825052643.GA26352@hysteria.proulx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: control 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: -1.5 (-) close 6104 thanks It has been a year since this issue in the bug tracking system has been address without any follow-up response. I believe the issue was resolved at the time. Closing the bug. Bob From unknown Sun Aug 10 12:54:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 22 Sep 2011 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator