This lovely item came across my feed today and I realized there is so much that I do poorly when it comes to shell scripting it is absurd 🙁

https://dev.to/thiht/shell-scripts-matter

Anyhow I am extremely thankful for this long and detailed post and wanted to pass it along to my readership.

I also wanted to crowd-source a bit of information from you all.

I am familiar with the idea of a code repository but have never really used one. I have had a lot of people suggest I use GIT. I am curious if that is the general consensus or if anyone else has other suggestions? I have a project that consists of some pretty crazy scripts (well, crazy for me, 1000+ lines). Trying to keep track of versions and changes in a script that large is difficult to say the least. I am looking for something easy to use and quick to deploy. Thoughts welcome.

1 of 1

2 comments on: My Shell Scripts Need Help

  1. David Dorothy
    Reply

    Git has become the defacto DVCS thanks largely in part to GitHub. Personally I prefer Mercurial but recently switched to Git because more people have familiarity with it and want to make sure my successor(s) are able to jump in quickly. Some colleges these days are also pushing Git. The only other one I really like but find difficult to deploy and that no one knows about is Fossil (www.fossil-scm.org) made by the maker of SQLite.

    For hosting I use GitLab currently. I tried a couple other free self hosted options but settled on GitLab because they have a dead simple install on Ubuntu. Add their repository to apt and then apt install gitlab-ce. On a dedicated machine it is as simple as that to get started. Plus when they have updates apt takes care of the details for me. If you need to do something custom their instructions are top notch (though I did have a little difficulty finding it at first).

    Also, Git has the benefit of using SSH keys so limiting what machines can download from the repository is as simple as adjusting SSH keys. No self signed SSL issues if you use self signed SSLs. GitLab makes it easy to set up keys for specific repositories and providing a server with read only access to specific repositories. To be fair, Mercurial and other Mercurial tools allow you to do this as well.

    If you prefer to have someone else host your code in a private repository, Bitbucket is probably the first place to look followed by GitHub. I believe Bitbucket allows you to have private repositories with a free account.

    You can host your code without a big service like GitLab or Bitbucket or GitHub but I don’t recommend it. For example when you have a low priority project and discover an issue that you can’t deal with now it is really convenient to add an issue/ticket to remind yourself to get back to it when you have more time. Also, if you work on a team and have multiple people who use said scripts/code and want them to be able to submit modifications but not mess with the code base you can use the pull request features.

    Hope that is helpful. Thanks.

  2. nbeam
    Reply

    Awesome! Thank you. I have been using SyncThing to keep files on my server in sync with files on my desktop but this is a duct-tape solution at best… no real versioning to speak of (well, I don’t use it). No ticketing/commenting/issues list either.

Join the discussion

Your email address will not be published. Required fields are marked *