Re local variables: I avoided locals as a bashism (not POSIX are they?) for the longest time but I've given in.
I also use bash getopts for any scripts which take arguments and will be re-used by other people. Bash getopts is so much better than /bin/getopt that I just can't ignore it. I also have created boilerplate templates for bash, perl, python over time, though I don't write so much anymore and have lost most of them. On Fri, May 13, 2016 at 10:38 AM Yves Dorfsman <[email protected]> wrote: > On 2016-05-13 06:30, Mark Lamourine wrote: > > I use Bash, but I have come to do something I don't see elsewhere much. > > > > I make a lot of use of functions and local variables. Basically any > time I > > see a coherent string of commands whether it's a pipe or a set of logical > > checks, I name the operation and put it in a function. String values are > > 'returned' as echo/cat output and logical values are just returned > normally. > > I honestly didn't know about local variables in bash until > Adam Moskowitz mentioned it in a private email. I will make sure to use > them > from now on! > > Once you've used any other prog language, bash seems to be inside out > (variable global by default, ignoring all errors by default, etc...) > > -- > http://yves.zioup.com > gpg: 4096R/32B0F416 > >
_______________________________________________ Tech mailing list [email protected] https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional System Administrators http://lopsa.org/
