emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-bug-tracker] bug#6582: closed (minor issue with du command)


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#6582: closed (minor issue with du command)
Date: Wed, 07 Jul 2010 23:08:02 +0000

Your message dated Wed, 7 Jul 2010 17:07:07 -0600
with message-id <address@hidden>
and subject line Re: bug#6582: minor issue with du command
has caused the GNU bug report #6582,
regarding minor issue with du command
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
6582: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6582
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: minor issue with du command Date: Wed, 7 Jul 2010 15:15:05 -0700
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).





--- End Message ---
--- Begin Message --- Subject: Re: bug#6582: minor issue with du command Date: Wed, 7 Jul 2010 17:07:07 -0600 User-agent: Mutt/1.5.18 (2008-05-17)
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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]