Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: String splitting
- X-seq: zsh-users 12670
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: "Przemyslaw Gawronski" <pgg@xxxxxxxxx>
- Subject: Re: String splitting
- Date: Sun, 2 Mar 2008 22:28:38 +0100
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=oV9lgwrqcGHwjKDvzD/xx9L7g3JRcQxok6JiufbsURo=; b=b/WODG0boAbBz3cGYFLO/i8su9QJIC/PG5NelTAK+LuB2HEZ63RoBm8J/uwujoTJg+M0cHdp9N95TUFMaFrWZmyx6DMSKqYDO0WG/gzLZunxq7TQCIjMSV9i/CHcERbHsQqQM7c4h69fXIU/Rkb0W5E9WE8nFojMAGr0UlOOepg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=g1iO0L06SntKnfKM2OWtEvaFcoMetPRaRSVcabnJz3XaC4rAT+PPVimHVGgbU9MM3Xot6vEIT7SBTmHUCy16kjmuuQ734kLoPecnLa7zyUqPRVNPz6B1Q0LIjX3FxxLJV0bVcjI6nSRMZM9tbealZdQzKeHHiPJmBwR83i/qiYU=
- In-reply-to: <20080302212258.GA19206@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080302212258.GA19206@xxxxxxxxxxxxxxxxxxx>
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