* Re: splitting and assigning
[not found] <20140524054323.GB4047__20662.9173866988$1400911201$gmane$org@solfire>
@ 2014-05-24 15:00 ` Christian Neukirchen
0 siblings, 0 replies; only message in thread
From: Christian Neukirchen @ 2014-05-24 15:00 UTC (permalink / raw)
To: zsh-workers
meino.cramer@gmx.de writes:
> Hi,
>
> I have a looooooong list, whgich consists
> of a 32 character long checksum (from md5sum),
> two spaces and a absolute path with the checksummed file.
>
> I want to split each line into two parts:
> the checksum and the path/file and assign each part
> to a separate variable.
>
> I tried to put this into a one-liner and failed using
> ${(s: :)line}.
% line="955e8d4f67775385bbbc58b4b113d7b9 file name with spaces"
% echo ${${(s: :)line}[1]}
955e8d4f67775385bbbc58b4b113d7b9
% echo ${${(s: :)line}[2]}
file name with spaces
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-24 15:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20140524054323.GB4047__20662.9173866988$1400911201$gmane$org@solfire>
2014-05-24 15:00 ` splitting and assigning Christian Neukirchen
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).