bug-coreutils
[Top][All Lists]
Advanced

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

Re: Basename bug with directory spaces


From: John Cowan
Subject: Re: Basename bug with directory spaces
Date: Sun, 20 May 2007 03:12:42 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

address@hidden scripsit:

> For example:
> 
> cd /home/ben/My\ Stuff
> basename $PWD

That's because $PWD is expanded into

        /home/ben/My Stuff

by the shell, which is interpreted as two arguments: basename processes
only the first one.  Try this:

$ basename "$PWD"
My Stuff
$

-- 
He played King Lear as though           John Cowan <address@hidden>
someone had played the ace.             http://www.ccil.org/~cowan
        --Eugene Field




reply via email to

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