From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 20:06:26 2010 Received: (at submit) by debbugs.gnu.org; 6 May 2010 00:06:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9obi-0001lp-6R for submit@debbugs.gnu.org; Wed, 05 May 2010 20:06:26 -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 1O9oSd-0001hY-Ax for submit@debbugs.gnu.org; Wed, 05 May 2010 19:57:03 -0400 Received: from lists.gnu.org ([199.232.76.165]:35989) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O9oSZ-0002P3-AQ for submit@debbugs.gnu.org; Wed, 05 May 2010 19:56:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9oSY-0003Rl-NU for bug-coreutils@gnu.org; Wed, 05 May 2010 19:56:58 -0400 Received: from [140.186.70.92] (port=37645 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9o2Q-0004u8-EF for bug-coreutils@gnu.org; Wed, 05 May 2010 19:30:02 -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.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9nss-0008HU-2a for bug-coreutils@gnu.org; Wed, 05 May 2010 19:20:07 -0400 Received: from mx1.riseup.net ([204.13.164.18]:38541) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9nsr-0008HL-Sk for bug-coreutils@gnu.org; Wed, 05 May 2010 19:20:06 -0400 Received: from auk.riseup.net (auk-pn.riseup.net [10.0.1.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 734B418C8FD; Wed, 5 May 2010 16:20:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: antoin@auk.riseup.net) with ESMTPSA id 4EB274FF8 Message-ID: <4BE1FD4F.2090207@elivefree.net> Date: Thu, 06 May 2010 00:20:47 +0100 From: Anthony User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: expert@mandrivalinux.org Subject: Re: [Expert] Bug in mv? References: <201005042236.19730.gene.heskett@gmail.com> <20100505024454.GA4003@huey> <201005050310.o453AXmu021153@elh7.elive.net> In-Reply-To: <201005050310.o453AXmu021153@elh7.elive.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.96 at mx1 X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 05 May 2010 20:06:25 -0400 Cc: bug-coreutils@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: -5.3 (-----) >>> 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. Hi Gene, As the others say, the behaviour you describe is exactly what one would expect mv to do with the arguments passed to it. > 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 only those two files. And the rest of the files in /home/me, > weren't bothered. No damages to the src directory at all other than > removing the files. The shell would have expanded two filenames as the first two arguments (separated by a space) to the mv command. > If it expanded that * to include the whole thing, it should have > moved the whole thing. It didn't. In past experience, the target > path spec's /* has always served as just a place holder for the > filenames actually selected by the amanda* in the src spec. That is > not what it did this time. This time it created a tmp/ directory in > /home/amanda, moved the whole amanda tree to the tmp directory, > including the two files I actually asked it to move from > /home/me/Download. No loss, but a very surprised veteran linux user. As other posters pointed out /home/amanda/* expands to a listing of every non-hidden (name doesn't start with a dot) file in /home/amanda. mv doesn't treat the results of the two wildcard expansions any differently. It simply always treats the very last argument as the destination directory. In this case /home/amanda/tmp had already been created by some other process and just happened to be the last filename to be expanded by the shell. (Had the last filename been an ordinary file and not a directory, mv would have given you an error.) Just to note: /home/amanda/* will expand very differently to /home/amanda* Most likely /home/amanda* would simply expand to /home/amanda - unless you have other directories such as /home/amanda.1 or /home/amanda.bak For my own part when I'm not exactly sure how wildcards will be expanded in a certain context, I'll substitute "echo" instead of the command name. e.g. echo amanda* /home/amanda/* would show you what arguments are being passed to the command. I also sometimes use the -i option for mv and rm commands so that I'm prompted yes or no for each file action and I almost always use the -v option so that I can see what the command is doing as it operates. Best regards, Anthony G 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 Thu Aug 14 22:23:34 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