- Add coreutils to PATH, because the xdg scripts use other not yet provided coreutils like head. This makes the custom 'cut' and 'sort' functions obsolete. Remove double quotes around $out because $out contains no Bash field separators. - Replace all instances of 'which' with 'type -P'. The previous sed command only replaced instances with a leading space.