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