split the script to 2, one for unix, one for windows.

because in cygwin, it always regards bat as a windows script, and
execute in wrong way.