5 ms·
My thumb rule is no extension if the script goes to the local bin folder and `.sh` otherwise. Beyond syntax highlighting, the extension also helps for wildcard
by asicsp 4y ago
My thumb rule is no extension if the script goes to the local bin folder and `.sh` otherwise. Beyond syntax highlighting, the extension also helps for wildcard matching for file operations (`ls`, `cp`, `for` loop, etc).
- _wolfie_ 4y agoThough in any non-trash editor you get syntax highlight based on shebang line alone. One advantage of no-extension is that you can swap the implementation language later without "breaking" shell history for people in your team.
- Sponge5 4y agoWhat I do is have a scripts folder where the names have extensions and which is version controlled and symlink them from `.local/bin`
- nrvn 4y agoAnd this rule has been followed the majority(if not all) interpreted and scripting languages. The likes of Ruby, python and JS have multiple examples. Whatever executable is in your $PATH it won’t have an extension. Not sure if this convention is actually documented anywhere. Random examples: - https://github.com/PyCQA/isort/blob/main/pyproject.toml#L100 https://github.com/PyCQA/isort/blob/main/pyproject.toml#L100 - https://github.com/pypa/pip/blob/main/setup.py#L78 https://github.com/pypa/pip/blob/main/setup.py#L78 - https://github.com/11ty/eleventy/blob/master/package.json#L10 https://github.com/11ty/eleventy/blob/master/package.json#L1...
- 0xbadcafebee 4y agoshellcheck *.sh FTW