Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change on stdout
- X-seq: zsh-users 14269
- From: Matt Wozniski <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Change on stdout
- Date: Fri, 31 Jul 2009 13:31:57 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0eM0nlr0oaBkforjNNhNYzx664aa1JfFwqMYMfH67i4=; b=cR2Ahz/+DDxxwhVdNZo+duQOf1OQ2p8bQDvK7DH2bXYxZL0Q8Apij6DyrVvxprvDUr dPXyh2tYE9w/E/90lHBZsLKFibm6aslz6bHD9QgglGIR/C9wz7kizyJkadP3EDtPEbjn vdhPmBfIdxPQ/1be7Xg3ojp26LRPV4VuIhgmA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wAXI7YspxxcKzYs4IPX+9YIiU9VXm+ACNb6IXLk2l9hJj0Z9895QqRTtihWDNq3fmw Ylkzwt/Pq5T31xVQBJcJf2nHwMZrYUsG/7PZxK4SuWOxNUmpof6SBPnfg/t4x3e9Cvaq 470slycco0aH2s973crS94M/21IHwAe/Wu22U=
- In-reply-to: <20090731175207.46af5c20.tartifola@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090731175207.46af5c20.tartifola@xxxxxxxxx>
On Fri, Jul 31, 2009 at 11:52 AM, <tartifola@xxxxxxxxx> wrote:
>
>
> Hi,
> I need to operate a transformation on the standard output
> of a command. The output is a list of numbers
>
> 1 5 8 ...
>
> and I like to have it transformed in
>
> a1=1,a2=5,a3=8,...
>
> Any suggestion?
Use a tool like sed - this should work with any verion of sed ever
made, I believe:
echo "1 2 3 4 5" | sed -e 's/[0-9][0-9]*/a&=&/g' -e 's/ /,/g'
Of course, this has nothing whatsoever to do with zsh, but I can't
think of any interpretation of your question that would...
~Matt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author