I'm actually trying to write a shell script that logs the output of a command to a file, but since the command takes a long time to complete (about 15 minutes), I would like to start parsing the output of the command (content of the file) before the command is completed, so I can send messages to the standard output (the user), like:
10% complete 45% complete
and so on.
- Redirect the command to a file: $(command) > $FILE
- Start reading and parsing the output ($FILE) before the command is finished.
I thought of using parallel programming, but I havent't got the hang of it.