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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Laurent TARRISSE" <ltarrisse <at> midilibre.com>
Subject: bug#9450: closed (Re: bug#9450: Bug report on 'dirname' : when
 jokers match several files)
Date: Wed, 07 Sep 2011 14:38:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#9450: Bug report on 'dirname' : when jokers match several files

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 9450 <at> debbugs.gnu.org.

-- 
9450: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9450
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Laurent TARRISSE <ltarrisse <at> midilibre.com>
Cc: 9450-done <at> debbugs.gnu.org
Subject: Re: bug#9450: Bug report on 'dirname' : when jokers match several
	files
Date: Wed, 07 Sep 2011 07:33:30 -0700
On 09/07/11 00:21, Laurent TARRISSE wrote:
> The 'bug' appeared on Linux, because dirname doesn't output the path when
> several arguments are passed to it. :)

The same 'bug' will also appear on Solaris 10; its
dirname does the same thing as GNU/Linux's dirname.

I'm afraid you're fighting an uphill battle here.
I'd fix the script rather than expecting
other implementations to match HP-UX's quirks.

I'm marking this as "done" since I don't expect
the GNU/Linux version to change.

[Message part 3 (message/rfc822, inline)]
From: "Laurent TARRISSE" <ltarrisse <at> midilibre.com>
To: <bug-coreutils <at> gnu.org>
Subject: Bug report on 'dirname' : when jokers match several files
Date: Tue, 6 Sep 2011 15:53:10 +0200
[Message part 4 (text/plain, inline)]
Hi

Here this a strange behaviour using 'dirname' with joker filename:

>ll  /tmp/*.out
ls: /tmp/*.out: No such file or directory
>dirname /tmp/*.out
/tmp

That's OK. But if several files match the argument given :

>ll  /home/qualiac/mdl/scriptsJDM/QuaToCov/emission/*.HL
-rw-r--r--  1 qualiac qualiac 20715696 Sep  6 02:15 /home/qualiac/mdl/scriptsJDM/QuaToCov/emission/M399111H.HL
-rw-r--r--  1 qualiac qualiac  1181326 Sep  6 02:16 /home/qualiac/mdl/scriptsJDM/QuaToCov/emission/T399111H.HL
-rw-r--r--  1 qualiac qualiac   225012 Sep  6 02:15 /home/qualiac/mdl/scriptsJDM/QuaToCov/emission/T399211H.HL
>dirname  /home/qualiac/mdl/scriptsJDM/QuaToCov/emission/*.HL
dirname: too many arguments
Try `dirname --help' for more information.

That's bad. If I try:

>dirname '/home/qualiac/mdl/scriptsJDM/QuaToCov/emission/*.HL'
/home/qualiac/mdl/scriptsJDM/QuaToCov/emission

That's OK.

Could 'dirname' process only its first parameter ?

Thanks.


----------------------------------------------
UNIX VERSION:
----------------------------------------------
>uname -a
Linux jdm-qualiac-srv-trv.midilibre.com 2.6.9-100.ELsmp #1 SMP Tue Feb 1 12:04:42 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
>uname -r
2.6.9-100.ELsmp
>cat /etc/issue
Red Hat Enterprise Linux ES release 4 (Nahant Update 9)
Kernel \r on an \m
[Message part 5 (text/html, inline)]

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.