Although this does not answer your question, here is how to shorten the command pipe by taking advantage of awk capabilities: dpkg --get-selections | awk '!/deinstall$/ {print $1}' -- Best regards, Jörg-Volker.