Zsh Mailing List Archive
Messages sorted by:
Re: Change on stdout
- X-seq: zsh-users 14274
- From: Matt Wozniski <godlygeek@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Change on stdout
- Date: Fri, 31 Jul 2009 16:57:11 -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=Y2LZBEMu4qEDdjWIsUhxOHwTjM/XDXa0lMnZYHlP5to=; b=VpPv5vUz5+hm2qh07RrX+F1Jbwkjh4i+vcJ4L2VVzxVyyEiTtrVz8OIarVTTJ10zpQ c78OOMLmbFPDh593efxmfMmqin5L46kHPZKDeKB7ICRhUgjzowfMioGdUaw7iazoT+jp NKZ5GMi8SFg0GghfwSQc+RebZ4z9w9LvoU5AE=
- 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=nbebu5I8LsmlMCTHqy+EZ8YHNhW7HFDniVN8EJ524pIkf1jLTSNPShxcrgrF8rEAo/ iO3SVxba3OwBZMYyWtBuAfuFC86C1BYF7JXEmvvnl9Z5ImEJFXioPYJ+vzMSacg1Dmw6 mcRzZ3X7200j8ARTqoyMLvDrzIVaOz4pa79hM=
- In-reply-to: <20090731173930.GA76414@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20090731175207.46af5c20.tartifola@xxxxxxxxx> <17393e3e0907311031t7e011c97m7f81e88aba78662a@xxxxxxxxxxxxxx> <20090731173930.GA76414@xxxxxxxxxxxxxxxxxxxxxx>
On Fri, Jul 31, 2009 at 1:39 PM, Erik Trulsson wrote:
> 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.
Oops, indeed; I misread. Still, though, I'd use perl for this over a
shell... Unless this is something for a completer or some such, where
the cost of a fork should be avoided wherever possible.
Messages sorted by: