From: Christian Neukirchen <chneukirchen@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: splitting and assigning
Date: Sat, 24 May 2014 17:00:49 +0200 [thread overview]
Message-ID: <8761kvql0e.fsf@gmail.com> (raw)
In-Reply-To: <20140524054323.GB4047__20662.9173866988$1400911201$gmane$org@solfire> (meino cramer's message of "Sat, 24 May 2014 07:43:23 +0200")
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
parent reply other threads:[~2014-05-24 15:19 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20140524054323.GB4047__20662.9173866988$1400911201$gmane$org@solfire>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8761kvql0e.fsf@gmail.com \
--to=chneukirchen@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).