Re:Bash_unit – bash unit testing framework
by chubot on Tuesday March 02, 2021 @03:01PM
(#26319805)
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 :)
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 :)