[Wolves] Rewriting bash scripts in a 'proper' language

Chris Ellis chris at intrbiz.com
Wed Oct 1 15:21:33 UTC 2014


Hi Simon

On Wed, Oct 1, 2014 at 2:57 PM, Simon Burke <simonb at fatsportsman.eu> wrote:

> So I spent most of this morning writing a script in Bash to automate a
> regular task. However as it requires user input for some fields and I've
> set up basic validation for said fields, it started to get out of hand. As
> its now getting horrendously long, found out things like how Bash handles
> functions and Bashs limitations with regex (i.e. doesnt support
> lookarounds).
>
> Considering this and the fact that it's likely to grow as I want to be
> able to scale it in multiple directions. I thought it would be a good time
> to brush up on my language skills. Seeing that I've not really used a
> language properly for about a year or so, even longer the last time I've
> used it in anger.
>
> So whats a nice language these days? considering that I only really know
> basic python, perl and ruby. Is Go worth looking at? The guys here keep
> suggesting php, but lets not get into the merits of php developers. :P
>
> How easy would it be to rewrite a large bash script into whatever
> language?
>

If your automating provisioning / deployment, then it is probably worth
looking at specific provisioning tools.
Often these tool have built in helpers for doing what takes many lines of
bash.  Ansible would be one to
look at, it operates over SSH and requires very few deps on the target
machines.

Otherwise, I've tended to favour using Perl, as I've been using that for a
while and I can't get past the lack
of braces in Python.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/wolves/attachments/20141001/ddad9737/attachment-0001.html>


More information about the Wolves mailing list