When creating a new Bash command that has multiple words, such as remove-unused-scripts, is there a common naming convention? For instance, should it be remove-unused-scripts, or remove_unused_script, or removeUnusedScripts, or something else entirely?
I'm fairly new to Bash, just want to make sure I don't form any bad habits early on.
Thank you for your time.
I think most languages recommend remove_unused_script
over removeUnusedScript
these days for readability. remove-unused-scripts
is a legal file name for a script. bash
allows function names to contain hyphens:
some-func () {
echo hi
}
but that isn't portable; POSIX function names are restricted to letters, numbers, and _
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With