GNU bug report logs - #9450
Bug report on 'dirname' : when jokers match several files

Previous Next

Package: coreutils;

Reported by: "Laurent TARRISSE" <ltarrisse <at> midilibre.com>

Date: Tue, 6 Sep 2011 14:03:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 9450 <at> debbugs.gnu.org (full text, mbox):

From: "Laurent TARRISSE" <ltarrisse <at> midilibre.com>
To: "Eric Blake" <eblake <at> redhat.com>
Cc: 9450 <at> debbugs.gnu.org
Subject: Re: bug#9450: Bug report on 'dirname' : when jokers match several
	files
Date: Tue, 6 Sep 2011 16:37:29 +0200
----- Original Message ----- 
From: "Eric Blake" <eblake <at> redhat.com>
To: "Laurent TARRISSE" <ltarrisse <at> midilibre.com>
Cc: <9450 <at> debbugs.gnu.org>
Sent: Tuesday, September 06, 2011 4:24 PM
Subject: Re: bug#9450: Bug report on 'dirname' : when jokers match several 
files


> 9450 tag wishlist
> thanks
>
> On 09/06/2011 07:53 AM, Laurent TARRISSE wrote:
>> Hi
>>
>> Here this a strange behaviour using 'dirname' with joker filename:
>
> The term is 'wildcard', not 'joker'

Please accept my apologizes. I'm french :)

>
>> dirname: too many arguments
>> Try `dirname --help' for more information.
>
> Thanks for the report.  To some degree, this is expected behavior: POSIX 
> requires that portable shell scripts pass exactly one argument to dirname, 
> so passing 0 or more than 1 arguments is necessarily in the realm of 
> non-portable code, and we would rather error out if we don't have any 
> better defined semantics for an extension.
>

OK for the answer.

>> Could 'dirname' process only its first parameter ?
>
> No.  But there _has_ been requests in the past to add an extension to GNU 
> coreutils to match BSD dirname/basename semantics of optionally taking 
> more than one parameter:
>
> https://lists.gnu.org/archive/html/bug-coreutils/2010-05/msg00015.html
>
> But so far, no one has submitted patches.  Therefore, I'll keep this bug 
> report open, but tag it as a wishlist.
>

Just let me explain... we had to reuse unix scripts, primarily written for 
HP UX

   >uname -a
   HP-UX ppbmo B.11.23 U ia64 3204054692 unlimited-user license

Some of our scripts, who did function perfectly on HP-UX for several years, 
encountered problems once moved on Linux platform.
One reason is due to dirname : on HP UX I can give several arguments to 
dirname, and as you say, on Linux I cannot. That's all. ;)




> -- 
> Eric Blake   eblake <at> redhat.com    +1-801-349-2682
> Libvirt virtualization library http://libvirt.org 





This bug report was last modified 13 years and 340 days ago.

Previous Next


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