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 #14 received at 9450 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: Laurent TARRISSE <ltarrisse <at> midilibre.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 11:36:05 -0600
Laurent TARRISSE wrote:
> 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. ;)

On HP-UX if you give several option arguments to dirname then the
HP-UX dirname would handle the first argument and then return an
error due to the extra arguments.  See this example:

  $ /usr/bin/dirname /one/two/three /four/five /six/seven
  /one/two

  $ echo $?
  1

  $ /usr/bin/dirname /one/two/three
  /one/two

  $ echo $?
  0

It is an error on HP-UX dirname to supply extra arguments too.  But
your scripts must be ignoring the error.  GNU dirname is simply
reporting the error more loudly.  :-)

What is your script expecting to happen with the extra arguments?
Surely that would also be a bug in your script since those extra
arguments are not getting processed.

Bob




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.