bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Feature request or advice on implementation for buffering command output


From: Anders Brujordet
Subject: Feature request or advice on implementation for buffering command output
Date: Wed, 27 Mar 2019 00:49:45 -0700

Usecase:
You run a command, the output is displayed in your terminal. Now that you
see the output, you would like to grab say an ID from this output. Instead
of coping and pasting the output, I would like to be able to do something
like:
# grep 'the thing that you want' <<< ${COMMAND_OUTPUT} | ./some_script

Where COMMAND_OUTPUT is the last n number of output lines from the previous
command.

Now, I've looked at several ways of implementing this is Bash. They all
break in various ways, because it usually means pushing all output to a
file/variable and then pushing it to stdout. Would it be feasible to have
Bash tee off anything intended for stdout to a variable?
Is there already some way of achieving this functionality?
If not, could anyone give me some pointers as to where or how this could be
implemented?

Thanks
Anders Brujordet


reply via email to

[Prev in Thread] Current Thread [Next in Thread]