Created
May 23, 2013 07:49
-
-
Save lottspot/5633358 to your computer and use it in GitHub Desktop.
This single loop script is designed to make it simple to gather any needed libraries to execute a particular executable in one location, such are during the creation of an initramfs.
This file contains 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 | |
########################################################################################################### | |
# | |
# Single loop for copying all dynamically linked libraries needed by an executable to a specified location | |
# | |
########################################################################################################### | |
EXECUTABLE=$1 | |
DEST=/path/to/destination/dir/ | |
for lib in $(ldd ${EXECUTABLE} | awk -F"=>" '{ print $2 }' | awk '{ print $1 }') | |
do cp $lib ${DEST} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment