emacs-bug-tracker
[Top][All Lists]
Advanced

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

[Emacs-bug-tracker] bug#8575: closed (Shell Script in Red Hat Enterprise


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#8575: closed (Shell Script in Red Hat Enterprise Linux Server release 5.5 (Tikanga))
Date: Thu, 28 Apr 2011 13:59:02 +0000

Your message dated Thu, 28 Apr 2011 07:58:45 -0600
with message-id <address@hidden>
and subject line basename [was: bug#8575: Shell Script in Red Hat Enterprise 
Linux Server release 5.5   (Tikanga)]
has caused the GNU bug report #8575,
regarding Shell Script in Red Hat Enterprise Linux Server release 5.5 (Tikanga)
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
8575: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8575
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Shell Script in Red Hat Enterprise Linux Server release 5.5 (Tikanga) Date: Thu, 28 Apr 2011 14:12:16 +0530
Hi,
 
I get the following error .
 
basename: invalid option -- b
Try `basename --help' for more information.
basename: missing operand
 
I have basename used as
 
CMDE=`\basename $0 .sh`
echo "$basename is $CMDE"
 
Doesn't o/p anything. Please

--
Regards,
Syed


--- End Message ---
--- Begin Message --- Subject: basename [was: bug#8575: Shell Script in Red Hat Enterprise Linux Server release 5.5 (Tikanga)] Date: Thu, 28 Apr 2011 07:58:45 -0600 User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9
retitle 8575 basename usage question
tag 8575 notabug
thanks

On 04/28/2011 02:42 AM, Syed Nizamuddin wrote:
> Hi,
> 
> I get the following error .
> 
> basename: invalid option -- b
> Try `basename --help' for more information.
> basename: missing operand

Thanks for the report.  However, this is not a bug in basename, but in
your usage.

> 
> I have basename used as
> 
> CMDE=`\basename $0 .sh`

That's your problem.  $0 expanded to "-bash", so basename is trying to
parse -b as an option.  Instead, use:

basename -- "$0" .sh

to avoid issues with $0 having a leading '-'.  If you want to do more
reading about this topic, see a similar report about dirname:
http://debbugs.gnu.org/8420

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

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