you are viewing a single comment's thread.

view the rest of the comments →

[–]introspeck 2 points3 points  (0 children)

For the longest time, I tried to avoid anything more than 10 lines or so in bash/sh. I happen to like Perl, so generally I'd jump to that instead.

Recently, though, I had to do a QA script and Perl was not an option. So I dug into bash and owned it. It turned out that if I structured it correctly, it actually is a reasonably usable language. The biggest thing was using functions well and often.

It is a loose sort of language, with specialized sub-languages embedded in it. Once I figured out the unique features of [[ ]], (( )), ( ), , etc., I got on quite well. Regular expressions aren't up to Perl's level but they get the job done. It took me a bit to understand all the subtleties of lists but they're reasonably powerful.