#!/bin/sh if [ -z "$2" ] ; then echo -e "Usage: $0 [--to|--from] filelist\nfiles must be in current dir" exit 1 fi DIR=$(mktemp -d /tmp/pcpXXXXXX) TRAVEL=$1 shift if [ $TRAVEL == "--to" ] ; then echo Copying $* to palm for a in $* ; do txt2pdbdoc -v -b $a $a $DIR/$a.pdb done ( cd $DIR && pilot-xfer --install ${*/%/.pdb} ) else if [ $TRAVEL == "--from" ] ; then echo Copying $* from palm ( cd $DIR && pilot-xfer --fetch $* ) for a in $* ; do txt2pdbdoc -v -d -b $DIR/$a.pdb $a done else echo "Need a direction" exit 1 fi fi rm -r $DIR && exit 0