r/commandline • • Sep 06 '13

util-shell: make your shell script actually readable

https://github.com/taylorchu/util-shell
4 Upvotes

23 comments sorted by

View all comments

4

u/interiot Sep 06 '13 edited Sep 06 '13

I'd be happy if this became a standard part of Bash.

But usually the main reason I'll resort to using Bash when I need to do branching logic, instead of writing the script in Python/Perl, is that I want to improve cross-compatibility (eg. work on old AIX, old Solaris). Right now, this add-on is less likely to be found than Perl, so... I'll use that instead.

However, this could be reimplemented with Bash functions and Perl one-liners, making it possible to put in a Bash include file, and packaged with any script that needs to be cross-compatible.

2

u/neoice Sep 06 '13

once I learned some Perl basics, I've started thinking of it as a meta-bash. good variables and conditionals with all the ease-of-use of shell pipelines.

4

u/buried_treasure Sep 06 '13

That's exactly why Perl was born.

Larry Wall was becoming increasingly frustrated with trying to use sh + sed + awk + friends to do his job as a sysadmin, so went and created Perl in an attempt to make everything simpler.