embedded script annoyance

So, this script is working, but the folder is being scanned twice because the script isn't exiting cleanly.
Why would this be? This is as simple as it gets; why is it exiting with a return value of 1?
(I'm embarrassed by the question, but want to sort it out. Thanks!)
- Code: Select all
OLD=`echo "$1"|sed 's/\-NEW//'`
rm "$OLD"
mv "$1" "$OLD"
return 0
Why would this be? This is as simple as it gets; why is it exiting with a return value of 1?
(I'm embarrassed by the question, but want to sort it out. Thanks!)