ack/mach/install
keie 081413cfda 1 - Allows 2 arguments, 1 - name of source in current directory.
2 - name of destination file(!path), default arg 1.
2 - Make the necessary dirctory.
3 - runs ranlib if "ar t ... | grep SYMDEF succeeds.
1985-01-11 16:43:56 +00:00

21 lines
525 B
Plaintext
Executable file

case $# in
1) DEST="$1" ;;
2) DEST="$2" ;;
*) echo $0 [source] destination ;;
esac
MACH=`(cd .. ; basename \`pwd\`)`
mkdir ../../../lib/$MACH >/dev/null 2>&1
if cp "$1" ../../../lib/${MACH}/$DEST >/dev/null 2>&1 ||
{ rm -f ../../../lib/${MACH}/$DEST >/dev/null 2>&1 &&
cp "$1" ../../../lib/${MACH}/$DEST >/dev/null 2>&1
}
then
if (ar t ../../../lib/${MACH}/$DEST | grep __.SYMDEF ) >/dev/null 2>&1
then
ranlib ../../../lib/${MACH}/$DEST
fi
exit 0
else
echo Sorry, can not create "lib/${MACH}/$DEST".
fi