From unknown Tue Jun 17 22:23:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6582: minor issue with du command Resent-From: Warren L Dodge Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 07 Jul 2010 22:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6582 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 6582@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12785427465157 (code B ref -1); Wed, 07 Jul 2010 22:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jul 2010 22:45:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdNA-0001L7-Rq for submit@debbugs.gnu.org; Wed, 07 Jul 2010 18:45:46 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdN7-0001L0-MH for submit@debbugs.gnu.org; Wed, 07 Jul 2010 18:45:42 -0400 Received: from lists.gnu.org ([199.232.76.165]:51476) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OWdN0-0000aW-Nz for submit@debbugs.gnu.org; Wed, 07 Jul 2010 18:45:34 -0400 Received: from [140.186.70.92] (port=44814 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWdMy-0005Pg-6s for bug-coreutils@gnu.org; Wed, 07 Jul 2010 18:45:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, RECEIVED_FROM_WINDOWS_HOST autolearn=no version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWdMt-0007lu-W5 for bug-coreutils@gnu.org; Wed, 07 Jul 2010 18:45:28 -0400 Received: from db3ehsobe001.messaging.microsoft.com ([213.199.154.139]:33450 helo=DB3EHSOBE001.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdMt-0007lV-Rf for bug-coreutils@gnu.org; Wed, 07 Jul 2010 18:45:27 -0400 Received: from mail44-db3-R.bigfish.com (10.3.81.242) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 8.1.436.0; Wed, 7 Jul 2010 22:15:19 +0000 Received: from mail44-db3 (localhost.localdomain [127.0.0.1]) by mail44-db3-R.bigfish.com (Postfix) with ESMTP id 28B971B864F for ; Wed, 7 Jul 2010 22:15:19 +0000 (UTC) X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzzz2dh) X-FB-SS: 13, Received: from mail44-db3 (localhost.localdomain [127.0.0.1]) by mail44-db3 (MessageSwitch) id 127854091918694_8282; Wed, 7 Jul 2010 22:15:19 +0000 (UTC) Received: from DB3EHSMHS009.bigfish.com (unknown [10.3.81.241]) by mail44-db3.bigfish.com (Postfix) with ESMTP id ED7861078051 for ; Wed, 7 Jul 2010 22:15:18 +0000 (UTC) Received: from igate.tek.com (192.65.41.20) by DB3EHSMHS009.bigfish.com (10.3.87.109) with Microsoft SMTP Server id 14.0.482.44; Wed, 7 Jul 2010 22:15:18 +0000 Received: from tektronix.tek.com (tektronix.tek.com [128.181.6.43]) by igate.tek.com (8.13.8+Sun/8.13.8) with ESMTP id o67MFHjk023580 for ; Wed, 7 Jul 2010 15:15:17 -0700 (PDT) Received: from mdhost.cse.tek.com (mdhost.cse.tek.com [128.181.15.25]) by tektronix.tek.com (8.13.8+Sun/8.13.8) with ESMTP id o67MFGNs008360 for ; Wed, 7 Jul 2010 15:15:17 -0700 (PDT) Received: from lwe127084.cse.tek.com (IDENT:U2FsdGVkX1/F4981ZlMTgzTJtPFPPM3pG0p5GDBKd34@lwe127084.central.tektronix.net [134.62.77.12]) by mdhost.cse.tek.com (8.12.3(P3.3.2003)/8.13.4) with ESMTP id o67MFA03010831 for ; Wed, 7 Jul 2010 15:15:10 -0700 (PDT) Received: from lwe127084.central.tektronix.net (localhost.localdomain [127.0.0.1]) by lwe127084.cse.tek.com (8.13.1/8.12.3) with ESMTP id o67MFAgv002204 for ; Wed, 7 Jul 2010 15:15:10 -0700 Received: (from warrend@localhost) by lwe127084.central.tektronix.net (8.13.1/8.13.1/Submit) id o67MF5Wu002198 for bug-coreutils@gnu.org; Wed, 7 Jul 2010 15:15:05 -0700 Date: Wed, 7 Jul 2010 15:15:05 -0700 From: Warren L Dodge Message-ID: <201007072215.o67MF5Wu002198@lwe127084.central.tektronix.net> X-CETC-MailScanner-Information: Please contact ecmail@mdhost.cse.tek.com for more information X-CETC-MailScanner: Found to be clean X-CETC-MailScanner-SpamCheck: spam X-MailScanner-From: warrend@tektronix.com MIME-Version: 1.0 Content-Type: text/plain X-Reverse-DNS: igate.tek.com X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.4 (------) 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: -6.4 (------) I did a du -s * .??* in my /tmp directory and got this du: invalid option -- 1 du: invalid option -- 2 du: invalid option -- 3 It turns out I had a directory named of all things "-123" I tried du -s /dev/null * .??* witht e same results. It seems like there would be a way to stop processing switches. But it looks like even if I put -123 as the last file of 30 others it still processes it as a switch. No big deal since this doesn't happen to much (I assume). From unknown Tue Jun 17 22:23:51 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: Warren L Dodge Subject: bug#6582: closed (Re: bug#6582: minor issue with du command) Message-ID: References: <20100707230707.GA16094@dementia.proulx.com> <201007072215.o67MF5Wu002198@lwe127084.central.tektronix.net> X-Gnu-PR-Message: they-closed 6582 X-Gnu-PR-Package: coreutils Reply-To: 6582@debbugs.gnu.org Date: Wed, 07 Jul 2010 23:08:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1278544082-5750-1" This is a multi-part message in MIME format... ------------=_1278544082-5750-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6582: minor issue with du command 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 6582@debbugs.gnu.org. --=20 6582: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6582 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1278544082-5750-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6582-done) by debbugs.gnu.org; 7 Jul 2010 23:07:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdhy-0001UT-C4 for submit@debbugs.gnu.org; Wed, 07 Jul 2010 19:07:14 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdhw-0001UM-G1 for 6582-done@debbugs.gnu.org; Wed, 07 Jul 2010 19:07:13 -0400 Received: from dementia.proulx.com (dementia.proulx.com [192.168.230.115]) by joseki.proulx.com (Postfix) with ESMTP id 0150521362; Wed, 7 Jul 2010 17:07:08 -0600 (MDT) Received: by dementia.proulx.com (Postfix, from userid 1000) id EC3023CC399; Wed, 7 Jul 2010 17:07:07 -0600 (MDT) Date: Wed, 7 Jul 2010 17:07:07 -0600 From: Bob Proulx To: Warren L Dodge Subject: Re: bug#6582: minor issue with du command Message-ID: <20100707230707.GA16094@dementia.proulx.com> References: <201007072215.o67MF5Wu002198@lwe127084.central.tektronix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201007072215.o67MF5Wu002198@lwe127084.central.tektronix.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 6582-done Cc: 6582-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.4 (--) Warren L Dodge wrote: > I did a du -s * .??* in my /tmp directory and got this > > du: invalid option -- 1 > du: invalid option -- 2 > du: invalid option -- 3 > > It turns out I had a directory named of all things "-123" Yes, that would do it. > It seems like there would be a way to stop processing switches. But > it looks like even if I put -123 as the last file of 30 others it > still processes it as a switch. That is a good idea! Hmm... What can we do about that. After due consideration we have added a way to stop processing arguments as options. Put a "--" on the command line after all of your option arguments and before your file arguments. Check your system as we have already updated it. :-) du -s -- -123 du -s -- * .??* Or traditionally prefixing the filename with a "./" also avoids having the file look like an option argument. du -s ./-123 du -s ./* ./.??* > No big deal since this doesn't happen to much (I assume). Unix folk tend to avoid filenames that start with an option letter or that contain spaces. Why cause trouble? But for robust operation you should always use either ./ or -- to avoid a filename being parsed as an option argument and creating a data dependent failure. Bob ------------=_1278544082-5750-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Jul 2010 22:45:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdNA-0001L7-Rq for submit@debbugs.gnu.org; Wed, 07 Jul 2010 18:45:46 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdN7-0001L0-MH for submit@debbugs.gnu.org; Wed, 07 Jul 2010 18:45:42 -0400 Received: from lists.gnu.org ([199.232.76.165]:51476) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OWdN0-0000aW-Nz for submit@debbugs.gnu.org; Wed, 07 Jul 2010 18:45:34 -0400 Received: from [140.186.70.92] (port=44814 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWdMy-0005Pg-6s for bug-coreutils@gnu.org; Wed, 07 Jul 2010 18:45:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, RECEIVED_FROM_WINDOWS_HOST autolearn=no version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWdMt-0007lu-W5 for bug-coreutils@gnu.org; Wed, 07 Jul 2010 18:45:28 -0400 Received: from db3ehsobe001.messaging.microsoft.com ([213.199.154.139]:33450 helo=DB3EHSOBE001.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdMt-0007lV-Rf for bug-coreutils@gnu.org; Wed, 07 Jul 2010 18:45:27 -0400 Received: from mail44-db3-R.bigfish.com (10.3.81.242) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 8.1.436.0; Wed, 7 Jul 2010 22:15:19 +0000 Received: from mail44-db3 (localhost.localdomain [127.0.0.1]) by mail44-db3-R.bigfish.com (Postfix) with ESMTP id 28B971B864F for ; Wed, 7 Jul 2010 22:15:19 +0000 (UTC) X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzzz2dh) X-FB-SS: 13, Received: from mail44-db3 (localhost.localdomain [127.0.0.1]) by mail44-db3 (MessageSwitch) id 127854091918694_8282; Wed, 7 Jul 2010 22:15:19 +0000 (UTC) Received: from DB3EHSMHS009.bigfish.com (unknown [10.3.81.241]) by mail44-db3.bigfish.com (Postfix) with ESMTP id ED7861078051 for ; Wed, 7 Jul 2010 22:15:18 +0000 (UTC) Received: from igate.tek.com (192.65.41.20) by DB3EHSMHS009.bigfish.com (10.3.87.109) with Microsoft SMTP Server id 14.0.482.44; Wed, 7 Jul 2010 22:15:18 +0000 Received: from tektronix.tek.com (tektronix.tek.com [128.181.6.43]) by igate.tek.com (8.13.8+Sun/8.13.8) with ESMTP id o67MFHjk023580 for ; Wed, 7 Jul 2010 15:15:17 -0700 (PDT) Received: from mdhost.cse.tek.com (mdhost.cse.tek.com [128.181.15.25]) by tektronix.tek.com (8.13.8+Sun/8.13.8) with ESMTP id o67MFGNs008360 for ; Wed, 7 Jul 2010 15:15:17 -0700 (PDT) Received: from lwe127084.cse.tek.com (IDENT:U2FsdGVkX1/F4981ZlMTgzTJtPFPPM3pG0p5GDBKd34@lwe127084.central.tektronix.net [134.62.77.12]) by mdhost.cse.tek.com (8.12.3(P3.3.2003)/8.13.4) with ESMTP id o67MFA03010831 for ; Wed, 7 Jul 2010 15:15:10 -0700 (PDT) Received: from lwe127084.central.tektronix.net (localhost.localdomain [127.0.0.1]) by lwe127084.cse.tek.com (8.13.1/8.12.3) with ESMTP id o67MFAgv002204 for ; Wed, 7 Jul 2010 15:15:10 -0700 Received: (from warrend@localhost) by lwe127084.central.tektronix.net (8.13.1/8.13.1/Submit) id o67MF5Wu002198 for bug-coreutils@gnu.org; Wed, 7 Jul 2010 15:15:05 -0700 Date: Wed, 7 Jul 2010 15:15:05 -0700 From: Warren L Dodge Message-ID: <201007072215.o67MF5Wu002198@lwe127084.central.tektronix.net> To: bug-coreutils@gnu.org Subject: minor issue with du command X-CETC-MailScanner-Information: Please contact ecmail@mdhost.cse.tek.com for more information X-CETC-MailScanner: Found to be clean X-CETC-MailScanner-SpamCheck: spam X-MailScanner-From: warrend@tektronix.com MIME-Version: 1.0 Content-Type: text/plain X-Reverse-DNS: igate.tek.com X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: submit 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: -6.4 (------) I did a du -s * .??* in my /tmp directory and got this du: invalid option -- 1 du: invalid option -- 2 du: invalid option -- 3 It turns out I had a directory named of all things "-123" I tried du -s /dev/null * .??* witht e same results. It seems like there would be a way to stop processing switches. But it looks like even if I put -123 as the last file of 30 others it still processes it as a switch. No big deal since this doesn't happen to much (I assume). ------------=_1278544082-5750-1--