bug-coreutils
[Top][All Lists]
Advanced

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

Re: basename for directories containing space


From: Alfred M. Szmidt
Subject: Re: basename for directories containing space
Date: Fri, 8 Sep 2006 11:58:17 +0200 (CEST)

   address@hidden NZ PostSep06]$ echo `pwd`
   /home/corrin/NZ PostSep06
   address@hidden NZ PostSep06]$ basename `pwd`
   NZ
   address@hidden NZ PostSep06]$ basename --version
   basename (GNU coreutils) 5.2.1
   Written by FIXME unknown.

   Surely the correct output is "NZ PostSep06"?

No, it isn't.  What gets passed to basename is:

basename NZ PostSep06

Two arguments, one being (to basename) a directory, and the other
(also to basename) a suffix.  You need to quote the argument properly,
namley:

basename "`pwd`"

Then it will work as you want.

   Disclaimer: This email and any files transmitted with it are
   confidential and may contain legally privileged material, intended
   solely for the use of the individual or entity to whom they are
   addressed. If you have received this e-mail message in error,
   please contact the sender and delete the material from any
   computer. Any use, review, dissemination, distribution or copying
   of this document by persons other than the intended recipient is
   strictly prohibited. Thank you

Please talk to your mail administrator so this blurb gets removed, if
you post to a public list there is nothing confidential about it.  The
last sentence is also illegal in most countries, there is this thing
called `fair use'.  Such disclaimers are not only impolite, but they
are also not legally binding in anyway.




reply via email to

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