Skip to content

Instantly share code, notes, and snippets.

@kuniss
Created June 12, 2016 20:56
Show Gist options
  • Save kuniss/79f906f46cc40022b440f54ad2622953 to your computer and use it in GitHub Desktop.
Save kuniss/79f906f46cc40022b440f54ad2622953 to your computer and use it in GitHub Desktop.
Code accompanying article "Let it flow!"
determineLibraryDependencies() {
read input
for f in $input; do
ldd $f | awk '/=>/ { print $1 }'
done
}
determineFullPathLibraryDependencies() {
read input
for f in $input; do
ldd $f | awk '/=>/ { if ( $3 == "" || match($3, "0x")) {print $1} else {print $3} }'
done
}
#!/bin/sh
ulimit -c 0
. ./determineLibraryDependencies.sh
echo $* | determineFullPathLibraryDependencies | sort -u -r | xargs -r -n 1 basename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment