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: wyrm <at> haell.com
To: 9450 <at> debbugs.gnu.org
Subject: bug#9450: Bug report on 'dirname' : when jokers match several files
Date: Wed, 7 Sep 2011 07:10:23 -0700
On 2011-09-07 at 09:21:45 +0200, ltarrisse <at> midilibre.com wrote:
> Yes, my script doesn't care about the return code. I use the dirname
> to extract the path from a given file, and then do a 'cd' command to
> that path :
>     MY_PATH=`dirname $1`
>     cd $MY_PATH
> As you say, HP-UX dirname returns 1, but neveetheless outputs the path
> of the first argument, and it's just what I expected him to do ! :))

Place some quotes around the argument, so that the variable will expand
but the glob won't. Something like:
	MY_PATH=`dirname "$1"`
will probably do what you expect.

-- 
Confucius is inscrutable.
God is ineffable.
Beer is inevitable.




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.