Thursday, October 23, 2008

My shell scripts

Shell script which copies all the libraries (dependencies) into the application's folder:

#!/bin/sh
ldd $1 | grep -io "/[a-zA-Z]*.*so.* " > $1deps
cat $1deps | sed 's/^/cp -f /' > $1.one
rm -rfd ldd_libs ; mkdir ldd_libs
sed 's/$/ ldd_libs/' $1.one > $1depstocopy.sh
rm -f $1deps $1.one
sh $1depstocopy.sh
echo "Done. Now cleaning...."
echo "checkout ldd_libs directory."
rm -f $1depstocopy.sh

No comments: