diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2014-10-16 23:15:43 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2014-10-16 23:15:44 +0200 |
commit | 60ec01326b5ebac366fe0b939262c2bf16de72ce (patch) | |
tree | 86f59cb54e63e38b312278867b30944355d94ff4 | |
parent | a67a8f2294c6f61a65ab524b13ceaefd6c4d8b18 (diff) | |
download | dotfiles-60ec01326b5ebac366fe0b939262c2bf16de72ce.tar.gz dotfiles-60ec01326b5ebac366fe0b939262c2bf16de72ce.tar.bz2 dotfiles-60ec01326b5ebac366fe0b939262c2bf16de72ce.zip |
Enhance check_libs even further
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() |