make the script work on linux

This is needed to make the script work on a Linux/Unix-like OS. Should test on windows before merging.