Using bare glob patterns can cause files with dash-prefixed names to be mistakenly interpreted as command options. To fix this, prefix glob patterns with './' or use '--' before them to ensure all matching files, including those with dash-prefixed names, are treated as arguments rather than options.
1
2# Noncompliant: Can accidentally delete files with names starting with '-'.
3rm *
1
2# Compliant: Safely removes all files in current directory, even those starting with '-'.
3rm ./* 2>/dev/null || rm -- *