I think this is the problem:
Code:
cp /lib/libncurses.so.5 .//lib/libncurses.so.5
There's one slash too much.
Please change the script to
Code:
APPS="/bin/bash /bin/ls /bin/mkdir /bin/mv /bin/pwd /bin/rm /usr/bin/id /usr/bin/ssh /bin/ping"
for prog in $APPS; do
cp $prog ./$prog
# obtain a list of related libraryes
ldd $prog > /dev/null
if [ "$?" = 0 ] ; then
LIBS=`ldd $prog | awk '{ print $3 }'`
for l in $LIBS; do
mkdir ./`dirname $l` > /dev/null 2>&1
cp $l .$l
echo "cp $l .$l"
done
fi
done