diff options
Diffstat (limited to '')
-rw-r--r-- | .zsh/zshfunctions | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/.zsh/zshfunctions b/.zsh/zshfunctions index 01e7394..a653ef5 100644 --- a/.zsh/zshfunctions +++ b/.zsh/zshfunctions @@ -32,18 +32,27 @@ check_libs() [Fields Display] Mapping" - for i in $(ps -A -o pid | tail -n +2); do - pmap -q -C<(<<<$pmapc) $i | - grep '(deleted)' | - tr -s ' ' | - cut -d' ' -f3 | - sort -u | - grep -v '\<zero\>\|\[aio\]\|SYSV0\|\<drm\>' \ - && - echo ' ↳' $(ps -o 'args=' $i) + local libs found=0 + + for i in $(ps -A -o 'pid='); do + libs=$(pmap -q -C<(<<<$pmapc) $i | + grep '(deleted)' | + grep -v '\<zero\>\|\[aio\]\|SYSV0\|\<drm\>' | + tr -s ' ' | + cut -d' ' -f3 | + sort -u) + + if [[ -n $libs ]]; then + (($found)) && echo #newline between entries + + found=1 + + echo $libs + echo ' ↳' $(ps -o 'args=' $i) + fi done - return 0 + return $found } menc() |