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

Re: iterating through a hierarchy with a filter



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