Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: alternative method for a simple for

On 15.09.2009, at 12:09, Mikael Magnusson wrote:

2009/9/15 Sebastian Stark <seb-zsh@xxxxxxxxxxx>:

On 15.09.2009, at 10:40, Joke de Buhr wrote:

On Tuesday 15 September 2009 05:54:19 d.henman wrote:

Maybe you want to use the short version of for. It's rather short

for file (*wav) ffmpeg -b 160k -i $file $file:r.mp3


for file (*wav) { ffmpeg -b 160k -i $file $file:r.mp3 }

That's short and clear syntax.

It is also incompatible and deprecated syntax :)

I think you're thinking of
for file in *.wav; command here
instead of
for file in *.wav; do command here; more commands; done

AFAIK, for file (list) {commands} isn't deprecated, just zsh-specific.

from zshmisc(1):

Many of zshâs complex commands have alternate forms. These particular versions of complex commands should be conâ sidered deprecated and may be removed in the future. The versions in the previous section should be preferred

Messages sorted by: Reverse Date, Date, Thread, Author