How to stream the output of a command in a bash script?
Project: | Programming |
Component: | Documentation |
Category: | support request |
Priority: | normal |
Assigned: | Unassigned |
Status: | active |
Related pages: | #303: Bash |
Tags: | bash script |
Description
Adding a command in a script will simply print the command output to the console.
But what if I want to filter the output, add to it, act upon it, etc.?
Right now, I simply assign the output of the command to a variable, print the variable and grep the variable to find the bits that interest me.
But if the command takes a long time to run, the user won't see any output until the command has finished running.
I want to do all of the above, while the user is seeing the output and the process progresses...