[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Make with zsh (was: whitespace in filenames)
From: |
Ted Zlatanov |
Subject: |
Make with zsh (was: whitespace in filenames) |
Date: |
Fri, 26 Sep 2008 09:43:09 -0500 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
On Thu, 25 Sep 2008 22:24:13 +0200 Louis-David Mitterrand <address@hidden>
wrote:
LM> On Thu, Sep 25, 2008 at 02:25:18PM -0500, Ted Zlatanov wrote:
>> On Thu, 25 Sep 2008 11:27:38 -0700 Patrick Horgan <address@hidden> wrote:
>>
PH> Rinehart, Raleigh wrote:
>> >> You can do a mass rename with something like this in a bash shell
>> >> (untested)
>> >> find . -name *.flac | while read f; do mv "$f" `echo "$f" | sed 's/
>> >> /-/g'`; done
>> >>
PH> I love Unix:)
>>
>> This is a bit cleaner and probably faster, since it skips files without
>> spaces in the name. Just give it directory names as arguments.
>>
>> perl -MFile::Find -e'find(sub { return unless m/\s/; $new = $_; $new
>> =~s/\s+/-/g; rename $_ => $new }, @ARGV)' DIR1 DIR2 ...
>>
LM> or if you have zsh and the 'rename' perl utility :
LM> % rename 's/\s+/-/g' **/*.flac
zsh has the zmv function which is even more appropriate, but I thought
that was too esoteric :)
Are there any caveats about using Make with zsh? I've run into some
bash compatibility issues outside of Make, but no problems in Make itself.
Ted
- Re: whitespace in filenames, (continued)
RE: whitespace in filenames, Rinehart, Raleigh, 2008/09/24
- Re: whitespace in filenames, Patrick Horgan, 2008/09/25
- Re: whitespace in filenames, Ted Zlatanov, 2008/09/25
- Re: whitespace in filenames, Patrick Horgan, 2008/09/25
- RE: whitespace in filenames, Dave Korn, 2008/09/25
- Re: whitespace in filenames, Patrick Horgan, 2008/09/25
Re: whitespace in filenames, Louis-David Mitterrand, 2008/09/25
Make with zsh (was: whitespace in filenames),
Ted Zlatanov <=
Re: Make with zsh (was: whitespace in filenames), Paul Smith, 2008/09/26
Re: Make with zsh (was: whitespace in filenames), David Boyce, 2008/09/26
Re: Make with zsh (was: whitespace in filenames), Martin d Anjou, 2008/09/26
RE: Make with zsh (was: whitespace in filenames), Brown, Michael l, 2008/09/26
Re: Make with zsh, Ted Zlatanov, 2008/09/29
RE: Make with zsh, Brown, Michael l, 2008/09/29