Answer the question
In order to leave comments, you need to log in
How to redirect the output of an interactive bash script to the input stream of another command?
There is a bash script that collects data from various servers (connects via ssh). The read built-in command is used, which allows you to enter sample data.
The output of the script must be piped to the sort command.
Question: how can I pass the output of the script to the input of another command. It is possible to write to a file through tee and then read from the file, but this method is not suitable. It is important that the script remains interactive.
PS Transfer through the pipe does not work.
Answer the question
In order to leave comments, you need to log in
Most likely you need to drive stdout or stderr into the pipe, without seeing the script I won’t say, but try to drive both there and then, something like this:
instead of a simple pipe, the second option is to use an extended pipe
, but returning to such scripts after a while can break your brain , so the first option is better, it's more readable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question