Blog Category: BASH

Git: Automatic Pre-Commit Unit Testing

29th June 2019

Git allows the user to run custom scripts at various points in it's workflow. This is done through hooks. Here we will use hooks to ensure that unit tests are passing before allowing a commit.

Read More

BASH: Writing a simple Backup Script

17th November 2018

Today we will be looking at how to write a simple Backup script using BASH and various Unix tools. Our script will determine the destination path and input file names by reading a plain-text file. It will then compress the input files into an archive in the destination path.

Read More

BASH: Minifying and combining JavaScript files

24th October 2018

Sass has the nice feature of taking a group of source files and putting them together as a single CSS file, with the advantage of reducing the number of HTTP connections the web browser has to open when loading your webpage, thus speeding it up. It also has the option to minify the code—taking out any characters that are purely cosmetic. In this article we will perform a similar task for JavaScript files, using BASH and a JavaScript minifier program.

Read More

BASH: Making a simple 'Yes/No' Prompt

19th October 2018

On Linux I often use the shutdown now command to shut down my computer, so I thought I would alias it to sdn. However, I was concerned that it might be too easy to accidentally type these three characters and end up losing unsaved work, so I decided to implement a prompt to confirm the shutdown. In this article we shall be looking at how I implemented this with a simple BASH script.

Read More