3 ms·
OK interesting, yeah with #!/bin/sh it points out that 'local' is not POSIX. But every shell I know of supports 'local'. It's not a "bash-ism' because it's un
by chubot 6y ago
OK interesting, yeah with #!/bin/sh it points out that 'local' is not POSIX.
But every shell I know of supports 'local'. It's not a "bash-ism' because it's universally supported.
I consider it essential; otherwise you might as well not use functions in shell.
This is a long argument (and is addressed in the same FAQ), but as someone who's written hundreds of thousands of lines of Python, I think shell is still better for a large set of tasks. A typical small project I write might have 300 lines of shell and 1000 lines of Python, rather than 5000 lines of Python.
But of course there are problems with using shell; if there weren't then Oil wouldn't exist :)
- justaj 6y agoAFAIK unsetting the variables first works too.