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.
in most cases no extension
no extension for commands that are like tools - placed in /usr/local/bin/ or user’s folder ~/.local/bin/
but I add extension for scripts that matters where they are placed, for example
./build.sh
and/mnt/my-disk/snapshot.sh
and source scripts in repo folder, such as github repo
tools/src/tool-name.sh
I symlink it from bin with no extension, example:
ln -sr ~/dev/gh/my-script-repo-name/my-script.sh ~/.local/bin/my-script
original source has extension, but not in bin folder