Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: iterating through a hierarchy with a filter
- X-seq: zsh-users 12785
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: iterating through a hierarchy with a filter
- Date: Tue, 15 Apr 2008 01:33:53 +0200
- In-reply-to: <4531F8C0-94EB-4803-A31F-3B961164C885@xxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <8BAD0AA6-3B6F-4946-B636-6C16B56A944E@xxxxxxxxx> <200804100851.m3A8pk9S003521@xxxxxxxxxxxxxx> <DDABD6BC-F3D9-4277-86C1-776B24CB914F@xxxxxxxxx> <20080410105245.GB11585@xxxxxxxxxxxx> <20080410114214.GB5179@xxxxxxxxxxxxxxx> <4531F8C0-94EB-4803-A31F-3B961164C885@xxxxxxxxx>
On 2008-04-14 14:39:25 -0700, Alexy Khrabrov wrote:
> I have the filter given as a parameter to my script, invoked as
> suggested,
>
> $filter < $file1 > $file2
>
> If I give a single existing script as a parameter, it works fine. If,
> however, I give it
>
> walk 'iconv -f utf8 -t cp1251' srcdir tgtdir ...
>
> -- I get "command not found" for 'iconv -f utf8 -t cp1251' at the line
> above. Since the walk script starts with
>
> #/bin/zsh
> filter=$1
You need to do sh word-splitting on $1 and make $filter an array:
filter=(${=1})
Alternatively, you can enable sh word-splitting globally.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author