Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change on stdout
- X-seq: zsh-users 14270
- From: Erik Trulsson <ertr1013@xxxxxxxxxxxxx>
- To: Matt Wozniski <godlygeek@xxxxxxxxx>
- Subject: Re: Change on stdout
- Date: Fri, 31 Jul 2009 19:39:30 +0200
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <17393e3e0907311031t7e011c97m7f81e88aba78662a@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090731175207.46af5c20.tartifola@xxxxxxxxx> <17393e3e0907311031t7e011c97m7f81e88aba78662a@xxxxxxxxxxxxxx>
On Fri, Jul 31, 2009 at 01:31:57PM -0400, Matt Wozniski wrote:
> 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...
That solution won't do what he asked for. The numbering of a1,a2, etc.
looks like they should be independent of the numbers in the list.
--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@xxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author