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

Re: String splitting



On 02/03/2008, Przemyslaw Gawronski <pgg@xxxxxxxxx> wrote:
> Hi, I want to split a string '/a/long/path/to/file' to an array:
>
>  ( a long path to file )
>
>  What would be the most zsh style way for that?

% a=/a/long/path/to/file
% b=(${(s:/:)a})
% print -l $b
a
long
path
to
file


-- 
Mikael Magnusson



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