GNU bug report logs - #15092
Dirname Bug

Previous Next

Package: coreutils;

Reported by: Axel Spallek <axel <at> spallek.org>

Date: Wed, 14 Aug 2013 07:46:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Axel Spallek <axel <at> spallek.org>
Cc: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, 15092 <at> debbugs.gnu.org
Subject: bug#15092: Dirname Bug
Date: Wed, 14 Aug 2013 12:36:32 +0200
tags 15092 notabug
close 15092
thanks

On 08/14/2013 11:45 AM, Erik Auerswald wrote:
> Hello Axel,
> 
> On Wed, Aug 14, 2013 at 09:16:14AM +0200, Axel Spallek wrote:
>> the following throw errors:
>>
>> dirname --to-0040257282759-in.wav
>> dirname "--to-0040257282759-in.wav"
>> dirname '--to-0040257282759-in.wav'
>>
>> IMHO at least the last two ones schould work.
> 
> If the arguments to a program start with a - or --, they are assumed to be
> options. You can use -- to stop option processing:
> 
> $ dirname -- --to-0040257282759-in.wav
> .

Another way would be to prefix it by a directory name,
either fully qualified, or just the current directory:

  $ dirname "./--to-0040257282759-in.wav"
 or
  $ dirname "$(pwd)/--to-0040257282759-in.wav"

> Quoting the arguments as in your last two examples does not affect this, as
> the shell does not interpret leading - characters in the command line, the
> program called does.

Or told in another way: in your examples above, dirname(1) saw
the same string as argument in all 3 cases.

There's some help for this sort of misunderstanding in our FAQ:

http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#How-do-I-remove-files-that-start-with-a-dash_003f

As this is not a bug in coreutils, I've marked it as such
and closed the bug.

Have a nice day,
Berny





This bug report was last modified 6 years and 302 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.