change flag=`ls /etc/texmf/texmf.d/*[^\.cnf$] 2> /dev/null | egrep -v '(.dpkg-.*|~)$'` to flag=`ls /etc/texmf/texmf.d/*[^\.cnf$] 2> /dev/null | egrep -v '(.dpkg-.*|~)$' || true` and it should work :) Cheers, p2.