Comment 38 for bug 1440608

Revision history for this message
Jarno Suni (jarnos) wrote :

Robert Euhus, as for #36,
-Strange, no such broken pipe error due to missing backslash-escape occured, when I tried the script I uploaded.
- You are correct, the awk regex for creating the "list" needs one more space, because the abbreviated status of a package seems to contain three characters, last of which is space (' '), if there is no error flag in the package status. (BTW the db:Status-Abbrev is not available in 12.04, but according to the tags, the fix is needed for 14.04 and later.) As for the advantage of using dpkg-query over dpkg -l , for the former you can define output format, whereas grepping dpkg's output, which contains header lines and some extra information is not a good practice IMO.
- As of the broken pipe due to exit in awk script, which awk you are using?
Does this give broken pipe in your system?
dpkg-query -W -f='${Package}\n' | awk '/dpkg/{print $1; exit}'
(It doesn't in mine.)