Trying to make it more compatible
Check if path is a directory and put the script inside it if it is. Also replace "[" by "[["