shell - Check if there are any running processes in the current tab of terminal -
i have script opens many terminal tabs devices plugged in, runs tests on devices. clean terminal tabs after tests done. run things in background, , don't know when each process done.
how can check if there process running in current tab of terminal?
i plan command w in applescript kill each terminal command after each tab of terminal has no running processes.
thanks!
if use applescript, can check busy property:
tell application "terminal" repeat t in tabs of windows if busy of t false script "exit" in t end if end repeat end tell
exit
closes tab if set "preferences > settings > shell > when shell exits" "close window".
Comments
Post a Comment