Implement save command strategy: pgrep

This commit is contained in:
Bruno Sutic
2014-09-20 23:53:51 +02:00
parent 9f7050aaae
commit ae9083e695
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PANE_PID="$1"
exit_safely_if_empty_ppid() {
if [ -z "$PANE_PID" ]; then
exit 0
fi
}
full_command() {
\pgrep -lf -P "$PANE_PID" |
cut -d' ' -f2-
}
main() {
exit_safely_if_empty_ppid
full_command
}
main