Created
May 1, 2017 10:11
-
-
Save bebehei/f61e14893a8939f2b48ee071c880f58b to your computer and use it in GitHub Desktop.
Get average of linked libraries in your $PATH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 'ldd % | wc -l | grep -v ^1$' | |
# ^ if file is not a dynamic linked executable, ldd will print one line on STDOUT, but we have to ignore this | |
find $(echo $PATH | tr : ' ') -mindepth 1 -maxdepth 1 \ | |
| xargs -I% bash -c 'ldd % | wc -l | grep -v ^1$' \ | |
while read line;\ | |
do l=$((l + line));\ | |
done \ | |
&& echo $l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment