#!/bin/bash # copy_install.sh # copies an executable and all its libraries into a given sub-tree folder. # Free Software under GPL licence : http://www.gnu.org/copyleft/gpl.html install -D $1 $2$1 for x in `ldd $1 | grep -o '/[^[:space:]]*'`; do # foreach lib if [ ! -e $2$x ]; then install -D $x $2$x; fi done