3 ms·
Is there any reason this should have #!/bin/bash as the shebang instead of #!/bin/sh ? Especially considering it has the extension of .sh instead of .bash
by justaj 4y ago
Is there any reason this should have #!/bin/bash as the shebang instead of #!/bin/sh ?
Especially considering it has the extension of .sh instead of .bash
- mynameisvlad 4y agoI don't think I've ever seen a script use a.bash extension, so I wouldn't put any weight on that.
- vbezhenar 4y agoIf I'm using bashisms, I'll use .bash extension. It's rare indeed, but that's because I'm trying to stay in pure sh way.
- jasonhansel 4y agoUsually you don't put any extension on scripts that use a shebang (#!), so that you can chmod +x them, put them in your path, and use them like normal commands (which don't have a suffix). IMHO the .sh extension should only be used for code that you're supposed to "source" instead of executing.
- mynameisvlad 4y agoDownloaded scripts do generally have extensions, and they are almost exclusively .eh, which was the point of my comment.
- flatiron 4y agoOnly if they are Canadian scripts.
- justaj 4y agoI only use .sh extensions for Bourne shell scripts and .bash for Bash scripts. It doesn't really matter in terms of executing scripts, but it's a handy visual indication.