[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: whitespace in filenames
From: |
Stephan Beal |
Subject: |
Re: whitespace in filenames |
Date: |
Wed, 24 Sep 2008 18:35:39 +0200 |
On Wed, Sep 24, 2008 at 5:13 PM, Louis-David Mitterrand
<address@hidden> wrote:
> FLACS := $(shell find ./flac -name "*.flac" -print)
Spaces in filenames are often problematic in the Unix, due to Unix's
tradition of using space as a separator. i don't know if you can
possibly get the quoting correct in Make code, but you might be able
to adjust your find command:
address@hidden:~/cvs/s11n.net/trunk$ touch 'foo bar'
address@hidden:~/cvs/s11n.net/trunk$ find . -name 'foo bar' -printf '"%f"\n';
"foo bar"
But that'll break once a name as double-quote chars in it. find has a
-print0 option which solves this problem when used together with
'xargs -0', but -print0's output won't be read properly by make. You
might be able to work around it by using a combination of find
-print0/xargs -0, and sed. Be aware, though, that the -print0/-0
options aren't in non-GNU find/xargs (AFAIK, at least not on stock
Solaris installations).
Or maybe one of the make gurus can provide something nicer.
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
RE: whitespace in filenames, Rinehart, Raleigh, 2008/09/24