Subject: bug#9450: closed (Re: bug#9450: Bug report on 'dirname' : when jokers match several files)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 07 Sep 2011 14:38:02 +0000

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 [email-masked].

-- 
9450: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9450
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#9450: Bug report on 'dirname' : when jokers match several files
From: Paul Eggert <[email-masked]>
To: Laurent TARRISSE <[email-masked]>
Cc: [email-masked]
Date: Wed, 07 Sep 2011 07:33:30 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

Subject: Bug report on 'dirname' : when jokers match several files
From: "Laurent TARRISSE" <[email-masked]>
To: <[email-masked]>
Date: Tue, 6 Sep 2011 15:53:10 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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