help-make
[Top][All Lists]
Advanced

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

How can I call "notdir" on a file name that contains spaces?


From: Eric Hanchrow
Subject: How can I call "notdir" on a file name that contains spaces?
Date: Wed, 01 Mar 2006 11:27:37 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.51 (gnu/linux)

Here's an example makefile that doesn't do what I want.

    name   := I have a space/x

    worse:
            @echo input  is $(name)
            @echo output is $(notdir $(name))

    # I see

    # input  is I have a space/x
    # output is I have a x


    # But I wish I'd have seen
    # input  is I have a space/x
    # output is x

At first, I thought this behavior was a bug, but then I realized that
it's working exactly as specified: notdir treats its argument as a
_whitespace-separated_ list of file names.  That makes it difficult to
deal with file names that themselves contains spaces.  Is there a way
to do it?
-- 
... at a contemporary beefsteak it is unusual for a man to do
away with more than six pounds of meat and thirty glasses of
beer.
        -- Joseph Mitchell





reply via email to

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