From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24774 invoked by alias); 24 May 2014 14:27:47 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18849 Received: (qmail 3534 invoked from network); 24 May 2014 14:27:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zxNankDaBlIuyt5BTGoiTodJ7eSX988Ppe0l/uKDOP4=; b=egGC5EhkcLPRy5nnjog/Nxp54Ys0HfBiCqeQnXoKBdXf93MihCKeUp/8x5NWA8sCDO wicOCmvB3ADXncSK4iDqW+WQouFAR3ZJK9xn94b0389aBHzsC+aoBM1WDry9rrTQJcFl cK9w87Jkqd3t5EfULJExTCXscs1vcmy+XOw0/zCMNsX88ujbTHN1LUnr1rpyGksMuwYX 89XxngFN+R4UcTkmIXiY5olWVsCw5mh/9yRVhWmnLcVVI6CB9CPR8AuxSpE9fIi7f+8q VtCv6rE7A/BI+kWxRFqxSpdQs/9hTEAvIKmQ+53dGN5go3QDGk2vsrDSuldbOt8wy4q5 3d7A== X-Gm-Message-State: ALoCoQkG8+xpcluQ0EVdiEfvac5pbRg+OKWGGPydAdT/bU31sxSsCjWvEo+aCdddKKjsSl/jBLYL MIME-Version: 1.0 X-Received: by 10.58.29.234 with SMTP id n10mr10205760veh.16.1400941649440; Sat, 24 May 2014 07:27:29 -0700 (PDT) In-Reply-To: <20140524054323.GB4047@solfire> References: <20140524054323.GB4047@solfire> Date: Sat, 24 May 2014 07:27:29 -0700 Message-ID: Subject: Re: splitting and assigning From: Kurtis Rader To: meino.cramer@gmx.de Cc: Zsh Users Content-Type: multipart/alternative; boundary=047d7bacc2345dc90d04fa2625a2 --047d7bacc2345dc90d04fa2625a2 Content-Type: text/plain; charset=UTF-8 Use the right tool for the job. At some point you need to consider switching to a different language. In Python the task is trivial. This is from an iPython interactive session: In [1]: data = ['md5sum#1 pathname#1', 'md5sum#2 pathname#2'] In [2]: data = [d.split() for d in data] In [3]: data Out[3]: [['md5sum#1', 'pathname#1'], ['md5sum#2', 'pathname#2']] In [4]: checksums, pathnames = zip(*data) In [5]: checksums Out[5]: ('md5sum#1', 'md5sum#2') In [6]: pathnames Out[6]: ('pathname#1', 'pathname#2') On Fri, May 23, 2014 at 10:43 PM, wrote: > 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}. > > How can I do that? > > Best regards and have a nice weekend! > Best regards, > mcc > > > > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank --047d7bacc2345dc90d04fa2625a2--