1234567891011121314151617181920212223242526272829303132 |
- #!/bin/bash
- if [ -z "${USER:-}" ]; then
- echo '$USER variable not defined.' >&2
- exit 1
- fi
- if [ ! -d /proc ]; then
- echo 'ERROR: /proc filesystem missing. We do not appear to be running on Linux.' >&2
- exit 1
- fi
- find /proc -maxdepth 2 -type f -user "${USER}" -readable -name maps -exec \
- awk -- '$0 ~ /libgamemodeauto\.so\.0/ {pid=FILENAME; gsub("[^0-9]", "", pid); print pid;nextfile}' {} + \
- | xargs | xargs -I{} -- ps -o pid,ppid,user,ni,psr,comm --pid '{}'
|