i’m pretty new to the shell scripting world and not sure, if i should give my scripts a .sh or .bash extension.
not sure what the pros and cons are.
i’m pretty new to the shell scripting world and not sure, if i should give my scripts a .sh or .bash extension.
not sure what the pros and cons are.
Usually I have most of my (admittedly very few) scripts be .sh with #!/bin/bash. I do have a few that don’t have an extension however, and those are in my $PATH intended to be used as shell commands
This is how I do it as well. Shell scripts that I include in a project are named with a .sh extension so other users can identify them easily. Scripts that I want to run as commands often are in my $HOME/bin/ and don’t have an extension. Sometimes those are convenience symlinks with easier names, so ~/bin/example might be a link to ~/repos/example-project/example-script-with-long-name.sh.