#!/bin/sh

i=1
sp="/-\|"
esc=""
reset="${esc}[0m"

# Since FreeBSD has an echo that doesn't know anything, and a /bin/sh that 
# doesn't handle positional variable access, we use a simpler ticker on 
# that platform.  It could be done with awk, but I'm not figuring it out
# right now.
testecho=/tmp/testecho-$$
echo -ne > $testecho
if grep -q "\-ne" $testecho; then
	while [ -e $1 ]
	do
  	echo -n "."
  	sleep 1
	done
	echo
else
	# Do something nicer platforms that allow it	
	while [ -e $1 ]
	do
  	echo -en "\b${sp:i++%${#sp}:1}"
  	sleep .2
	done
	echo -en "${reset}\b"
fi
