Delete script before writing to it

This way we avoid chmod permission errors when the current user is not the script owner.
Update HISTORY.txt
Fixed typo
Merge pull request #4 from alecghica/master

Delete script before writing to it