Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Clustered output of a function
- X-seq: zsh-users 26488
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Clustered output of a function
- Date: Wed, 10 Feb 2021 12:31:19 +0100
- Archived-at: <https://zsh.org/users/26488>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-02/20210210113119.GA2435%40gmx.de>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxx>
- Reply-to: dominik.vogt@xxxxxx
There is a shell function that takes input from stdin, processes
that and responds by printing multiple lines to stdout for each
line in stdin, E.g.
input line 1 ->
output A1
output B1
input line 2 ->
output C2
input line 2 ->
output A3
output B3
I.e. the output order is
A1 B1 C2 A3 B3.
Now, all A-lines should be in a block before all other output lines:
A1 A3 B1 C2 B3
The point is, I'm looking for a way to do this (a) without using
temporary files, (b) without parsing the input twice, and (c)
without buffering the output in variables.
--
Is there a nice way to "park" the second block of output somewhere
and emit it just before the function terminates?
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author