[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#8420: dirname
From: |
Etienne Buira |
Subject: |
bug#8420: dirname |
Date: |
Mon, 4 Apr 2011 18:13:24 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Apr 04, 2011 at 03:43:36PM +0200, Michele Marigliano wrote:
> Hi,
Hi.
> I execute the following bash command on RH 5.3
>
> CURRENT_DIR=`/usr/bin/dirname $0`
Beware that it will give the script dirname (if specified), not the
current working directory (that you can get using pwd).
> /usr/bin/dirname: invalid option -- b
>
> Try `/usr/bin/dirname --help' for more information.
>
> address@hidden ~]$ /usr/bin/dirname --version
>
> dirname (GNU coreutils) 5.97
You might want to upgrade, it is an ancient version.
> $ echo $0
>
> -bash
Options are introduced by a hyphen (which your binary name starts with),
if you want to tell that what follows is not option anymore, you want
to use '--'. So your lines looks like that:
CURRENT_DIR=`/usr/bin/dirname -- $0`
(works at least with coreutils8.7, don't know about your version).
> $ echo $0
>
> -bash
>
> $ dirname
>
> dirname: too few arguments
Yes, it understood it like "dirname -b -a -s -h", whithout any filepath.
- bug#8420: dirname, Michele Marigliano, 2011/04/04
- bug#8420: dirname, Eric Blake, 2011/04/04
- bug#8420: dirname,
Etienne Buira <=
- bug#8420: dirname, Bjartur Thorlacius, 2011/04/04
- bug#8420: dirname, Eric Blake, 2011/04/04
- bug#8420: dirname, Bjartur Thorlacius, 2011/04/04
- bug#8420: dirname, Eric Blake, 2011/04/04
- bug#8420: dirname, Bjartur Thorlacius, 2011/04/05
- bug#8420: dirname, Eric Blake, 2011/04/05
- bug#8420: dirname, Bjartur Thorlacius, 2011/04/07
bug#8420: I: bug#8420: dirname, Michele Marigliano, 2011/04/04