New: option -g extend watch to process group#122
New: option -g extend watch to process group#122step- wants to merge 1 commit intoXfennec:masterfrom
Conversation
So `progress -g -p <pid>` will show the current progress of <pid> and
all the processes (max 32 compile-time constant) that are in <pid>'s
process group (ps -o pgrp). And `progress -m -g -p <pid>` will monitor
the group till <pid> exits. This can be useful when monitoring shell
scripts that copy data using several basic commands, e.g.,
./script & progress -m -g -p $!
./script & xterm -e progress -m -g -p $! & wait
Note: Implemented for Linux only. The `__APPLE__` define branch has a
stub.
|
Great idea, this is a nice addition to the project. I would like to see an OSX implementation before merging this, but I'm not excluding to merge it anyway if no contribution land on this subject. |
|
I'm glad you like it. I am unable to implement it for OSX. I have no Apple hardware and no experience of OSX, sorry. |
|
A note about working around a common situation that prevents using If you write a script that includes meaning, show all activity for the script's process group, and you run the script from the command line, However, if you run the script by clicking its icon in a file manager, The work-around involves writing the script so that it takes its own process group when it's started from the GUI instead of from a terminal. However, after reading some google links: [1] [2] [3], my conclusion is that a general work-around that covers all cases and runs from within the script doesn't exist. So each work-around needs to be specific to the script and the use case. |
This is a new feature
progress -g -p <pid>will show the current progress of <pid> and all the processes (max 32 compile-time constant) that are in <pid>'s process group (ps -o pgrp). Andprogress -m -g -p <pid>will monitor the group till <pid> exits. This can be useful when monitoring shell scripts that copy data using several basic commands, e.g.,The second line above can be added inside any script that monitors its own copy progress.
Note: Implemented for Linux only. The
__APPLE__define branch has a stub.