1

Environment: aptitude called in a script.

I'm having problems with this command:

aptitude search '?virtual' |grep ^v |grep -v i386|sort|uniq 

In particular if I do:

aptitude search '?virtual' |grep ^v |grep -v i386|sort|uniq|grep adblock 

I get (as one of the results):

v adblock-plus-element-hiding-hel - 

instead of what I want:

v adblock-plus-element-hiding-helper - 

How do I get aptitude to print the full package name in a script?

1 Answer 1

4

You need to tell aptitude not do do any special column formatting.

--disable-columns

This option causes aptitude search and aptitude versions to output their results without any special formatting. In particular: normally aptitude will add whitespace or truncate search results in an attempt to fit its results into vertical “columns”. With this flag, each line will be formed by replacing any format escapes in the format string with the corresponding text; column widths will be ignored.

So do this instead:

$ aptitude search '?virtual' --disable-columns|grep ^v |grep -v i386|sort|uniq v a52dec - v a52dec-dev - v aac-tactics - v aalib1 - v aalib-bin - v acl-dev - v ada-compiler - v aide-binary - v alphy - ... 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.