3 ms·
> All FreeBSD scripts I encountered use posix shell. Defaults matter, and it's helpful when the default shell for command-line use matches the shell used for s
by JoshTriplett 7y ago
> All FreeBSD scripts I encountered use posix shell.
Defaults matter, and it's helpful when the default shell for command-line use matches the shell used for scripting, because people often do scripting on the command line.
- jlg23 7y agoShell scripts are usually interoreted by the interpreter defined in the shebang and /bin/sh is a posix sh.
- JoshTriplett 7y agoThat's my point: the shell used on the command line should use similar syntax to the shell people most commonly use for scripting.
- petre 7y ago/bin/sh is mostly intended for scripts, less so as an interactive user shell. It needs to be small, fast and as bugfree as possible, as opposed to offering a plethora of user interactive features. That's why FreeBSD uses sh and debian uses dash for this purpose.
- throw0101a 7y agoTell that to Debian/Ubuntu as well: default user shell is Bash, default /bin/sh is dash. If you need more-than-POSIX in your scripts, then use the proper shebang.
- JoshTriplett 7y agoI use Debian, and I'm aware. Bash still uses primarily POSIX sh syntax, with extensions. It's helpful for people to be able to apply knowledge from the command line to shell scripting and vice versa, even if they have to do a bit of porting work, rather than using completely different shells and syntax.