fix link.sh and add EDITOR to the environment