diff --git a/trm.sh b/trm.sh
index a3286d4..d70b336 100755
--- a/trm.sh
+++ b/trm.sh
@@ -230,7 +230,10 @@
 # just loading the function above into the current shell context.)
 #####
 
-if [ $(basename "$0") = "trm.sh" ]
+# For some reason, bash on FreeBSD returns $0 with a leading "-"
+# which breaks the logic if we don't scrub it out here.
+
+if [ $(basename $(echo "$0" | sed s/^-//)) = "trm.sh" ]
 then
     trm "$@"
 fi