Sunday, August 30, 2015

Developp Bash script without worrying


I have often used bash to write shell script. In most cases, you have to hurry up and you don't go further into ... Here is two tips that could help you.

Developp without worrying


To developp bash script, it's better to use the following :


#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

With theses paramters, you will be able to detect silent errors, un intialize variables and so on...
See that good link for more details : http://redsymbol.net/articles/unofficial-bash-strict-mode/


Help in syntax



Here is a cool link to help you in shell syntax : http://www.shellcheck.net/