From unknown Tue Jun 17 20:42:48 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#6582 <6582@debbugs.gnu.org> To: bug#6582 <6582@debbugs.gnu.org> Subject: Status: minor issue with du command Reply-To: bug#6582 <6582@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:42:48 +0000 retitle 6582 minor issue with du command reassign 6582 coreutils submitter 6582 Warren L Dodge severity 6582 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 07 18:45:46 2010 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). From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 07 19:07:14 2010 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 07 19:23:20 2010 Received: (at 6582-done) by debbugs.gnu.org; 7 Jul 2010 23:23: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 1OWdxX-0001bJ-Jz for submit@debbugs.gnu.org; Wed, 07 Jul 2010 19:23:19 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12] helo=TX2EHSOBE003.bigfish.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWdxV-0001bE-I1 for 6582-done@debbugs.gnu.org; Wed, 07 Jul 2010 19:23:18 -0400 Received: from mail83-tx2-R.bigfish.com (10.9.14.253) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 8.1.340.0; Wed, 7 Jul 2010 23:23:13 +0000 Received: from mail83-tx2 (localhost.localdomain [127.0.0.1]) by mail83-tx2-R.bigfish.com (Postfix) with ESMTP id 480623E0450; Wed, 7 Jul 2010 23:23:12 +0000 (UTC) X-SpamScore: -18 X-BigFish: VPS-18(zz1432N98dN179dNzz1202hzzz2dh61h) X-Spam-TCS-SCL: 0:0 Received: from mail83-tx2 (localhost.localdomain [127.0.0.1]) by mail83-tx2 (MessageSwitch) id 1278544991724539_18377; Wed, 7 Jul 2010 23:23:11 +0000 (UTC) Received: from TX2EHSMHS044.bigfish.com (unknown [10.9.14.238]) by mail83-tx2.bigfish.com (Postfix) with ESMTP id AB244E3070C; Wed, 7 Jul 2010 23:23:11 +0000 (UTC) Received: from igate.tek.com (192.65.41.20) by TX2EHSMHS044.bigfish.com (10.9.99.144) with Microsoft SMTP Server id 14.0.482.44; Wed, 7 Jul 2010 23:23:11 +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 o67NNACl028387; Wed, 7 Jul 2010 16:23:10 -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 o67NNAHE019940; Wed, 7 Jul 2010 16:23:10 -0700 (PDT) Received: from lwe127084.cse.tek.com (IDENT:U2FsdGVkX1+QWbSlZxMzlAftP/jzwZzqC2CdiPb1bhs@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 o67NN803011675; Wed, 7 Jul 2010 16:23:08 -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 o67NN8Os017695; Wed, 7 Jul 2010 16:23:08 -0700 Received: (from warrend@localhost) by lwe127084.central.tektronix.net (8.13.1/8.13.1/Submit) id o67NN2Hv017692; Wed, 7 Jul 2010 16:23:02 -0700 Date: Wed, 7 Jul 2010 16:23:02 -0700 Message-ID: <201007072323.o67NN2Hv017692@lwe127084.central.tektronix.net> From: Warren Dodge To: Bob Proulx In-Reply-To: <20100707230707.GA16094@dementia.proulx.com> (message from Bob Proulx on Wed, 7 Jul 2010 17:07:07 -0600) Subject: Re: bug#6582: minor issue with du command References: <201007072215.o67MF5Wu002198@lwe127084.central.tektronix.net> <20100707230707.GA16094@dementia.proulx.com> 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-Spam-Score: -2.6 (--) 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 Reply-To: warren.l.dodge@Tektronix.com 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: -3.8 (---) Thanks. I did figure the ./ out after I sent the report. I looked for -- in the man page but didn't see it. So I didn't try it. Does -- need added there? Or is it just "common knowledge". > Date: Wed, 7 Jul 2010 17:07:07 -0600 > From: Bob Proulx > CC: 6582-done@debbugs.gnu.org > MIME-Version: 1.0 > Content-Type: text/plain; charset="us-ascii" > Content-Disposition: inline > > 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 > > From unknown Tue Jun 17 20:42:48 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, 05 Aug 2010 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