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/

2 comments:

  1. Very great post. I simply stumbled upon your blog and wanted to say that I have really enjoyed browsing your weblog posts. After all I’ll be subscribing on your feed and I am hoping you write again very soon!

    ReplyDelete