#!/bin/sh
for i in ldd $1 | awk -F '=> ' '{print $2}' | grep '/'| awk -F ' ' '{print $1}'
; do TO=echo $i |sed -e 's/\///'
; TOPATH=echo $TO| sed -e 's/\(.*\)\(\/.*\)/\1/'
; [ -e $TOPATH ] || echo sudo mkdir -p $TOPATH; [ -e $i ] || echo sudo cp -v $i $TO ; done