working on #672 NOTE: This commit can't be compiled!!
All bash script here must be compatible with following environments:
linux: bash 4.x
windows: git for windows 2.9.3
osx