bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in basename?


From: Richard Dawe
Subject: Re: Bug in basename?
Date: Tue, 01 Oct 2002 20:58:29 +0100

Hello.

Darren wrote:
[snip]
> I *believe* there is a bug in basename, it is reproducable.  Demonstrated
> by the example below.  I apologise in advance if it is not and my
> understand is at fault.
[snip]
> $ a="gfgfgfgfgfgfgfgfgfgfytytytytytjhjhjhjhjh8686868686 - "
> $ b=`basename $a`
> $ a="gfgfgfgfgfgfgfgfgfgfytytytytytjhjhjhjhjh8686868686 - 17 "
> $ b=`basename $a`
> $ basename: too many arguments
> Try `basename --help' for more information.
[snip]

This is a shell expansion issue. You need to quote $a in the backticks, since
$a is expanded. I.e.:

    b=`basename "$a"`

HTH. Regards,

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]