I try to use the long-form of command-line switches in scripts, e.g. `cp --force` instead of `cp -f`.
This works around malicious filenames that may start with a '-'. Especially important if you're running an 'rm' command
Edit: another workaround is to ensure that files are always absolute pathnames or even starting with './' for relative ones.