summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2014-10-16 23:15:43 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2014-10-16 23:15:44 +0200
commit60ec01326b5ebac366fe0b939262c2bf16de72ce (patch)
tree86f59cb54e63e38b312278867b30944355d94ff4
parenta67a8f2294c6f61a65ab524b13ceaefd6c4d8b18 (diff)
downloaddotfiles-60ec01326b5ebac366fe0b939262c2bf16de72ce.tar.gz
dotfiles-60ec01326b5ebac366fe0b939262c2bf16de72ce.tar.bz2
dotfiles-60ec01326b5ebac366fe0b939262c2bf16de72ce.zip
Enhance check_libs even further
-rw-r--r--.zsh/zshfunctions29
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()