dest=`echo backup-*`
if [ "x$dest" != 'xbackup-*' ]; then
- dest="`pwd`/`ls -1d backup-* | tail -n1`"
+ # -F and grep is used to list only directories, zsh's *(/) would be great.
+ dest="`pwd`/`ls -1dF backup-* | grep / | tail -n1`"
fi
target=backup-`date '+%Y-%m-%d-%H-%M-%S'`