Make the script more portable: grub.mkconfig is built from gub-mkconfig.in with something like this: grub-mkconfig: util/grub-mkconfig.in $(top_builddir)/config.status $(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@ chmod a+x grub-mkconfig autotools do the substitutions of placeholders used in grub-mkconfig.in prefix=@prefix@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ bindir=@bindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ PACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_VERSION=@PACKAGE_VERSION@ host_os=@host_os@ datarootdir=@datarootdir@ datadir=@datadir@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`