Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #255500
| From | Greg Wooledge <greg@wooledge.org> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: solution to / full |
| Date | 2023-03-02 13:30 +0100 |
| Message-ID | <G4Qel-9yfo-7@gated-at.bofh.it> (permalink) |
| References | <G4uQx-9k2C-1@gated-at.bofh.it> <G4vtf-9kvS-1@gated-at.bofh.it> <G4NJv-9wdI-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Mar 02, 2023 at 09:45:38AM +0000, Jonathan Dowland wrote:
> --✂--✂--✂--✂--✂--✂--✂--✂--✂--✂ --✂--✂--✂--✂--✂--✂--✂--✂--✂--✂--
>
> STATUS_FILE=/var/lib/dpkg/status
> dpigs()
> {
> TL=${1-10}
> awk -v RS='' '/Status:.*installed\n/' "$STATUS_FILE" \
> | grep -E '^(Installed-Size|Package)' \
> | cut -d: -f2- \
> | paste - - \
> | sort -rnk2 \
> | awk '{ print $2 "\t" $1 }' \
> | head -n "$TL" \
> | tac
> }
> dpigs "$@"
>
> --✂--✂--✂--✂--✂--✂--✂--✂--✂--✂ --✂--✂--✂--✂--✂--✂--✂--✂--✂--✂--
I don't understand why you used sort -r, but then reversed it again with
tac at the end. You could drop both of the reversals, and just change
head to tail.
Anyway... I wrote mine in perl, quite a few years ago (timestamp says
September 2004). There's a copy at <https://wooledge.org/~greg/ds>.
I named it before I even knew that "dpigs" existed. I can't blame past
me for not knowing... dpigs is extremely well hidden.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
solution to / full lina <lina.lastname@gmail.com> - 2023-03-01 14:40 +0100
Re: solution to / full Jochen Spieker <ml@well-adjusted.de> - 2023-03-01 15:20 +0100
Re: solution to / full The Wanderer <wanderer@fastmail.fm> - 2023-03-01 18:00 +0100
Re: solution to / full Jonathan Dowland <jon+debian-user@dow.land> - 2023-03-02 10:50 +0100
Re: solution to / full Greg Wooledge <greg@wooledge.org> - 2023-03-02 13:30 +0100
Re: solution to / full Jonathan Dowland <jon+debian-user@dow.land> - 2023-03-02 14:20 +0100
Re: solution to / full Curt <curty@free.fr> - 2023-03-03 16:50 +0100
Re: solution to / full davidson <davidson@freevolt.org> - 2023-03-03 20:10 +0100
Re: solution to / full David Wright <deblis@lionunicorn.co.uk> - 2023-03-04 18:20 +0100
Re: solution to / full Jonathan Dowland <jon+debian-user@dow.land> - 2023-03-06 11:50 +0100
Re: solution to / full Jonathan Dowland <jon+debian-user@dow.land> - 2023-03-06 15:20 +0100
Re: solution to / full Klaus Singvogel <klaus@singvogel.net> - 2023-03-01 17:00 +0100
Re: solution to / full <tomas@tuxteam.de> - 2023-03-01 17:50 +0100
Re: solution to / full Brian <ad44@cityscape.co.uk> - 2023-03-01 19:20 +0100
Re: solution to / full <tomas@tuxteam.de> - 2023-03-01 19:40 +0100
Re: solution to / full Brian <ad44@cityscape.co.uk> - 2023-03-01 21:30 +0100
Re: solution to / full Greg Wooledge <greg@wooledge.org> - 2023-03-01 19:40 +0100
Re: solution to / full Joe <joe@jretrading.com> - 2023-03-01 21:00 +0100
Re: solution to / full Greg Wooledge <greg@wooledge.org> - 2023-03-01 21:10 +0100
Re: solution to / full Brian <ad44@cityscape.co.uk> - 2023-03-01 21:30 +0100
Re: solution to / full Joe <joe@jretrading.com> - 2023-03-01 20:50 +0100
Re: solution to / full Brian <ad44@cityscape.co.uk> - 2023-03-01 21:20 +0100
Re: solution to / full songbird <songbird@anthive.com> - 2023-03-03 05:10 +0100
Re: solution to / full David Wright <deblis@lionunicorn.co.uk> - 2023-03-03 06:20 +0100
Re: solution to / full Andy Smith <andy@strugglers.net> - 2023-03-01 18:10 +0100
Re: solution to / full Nicolas George <george@nsup.org> - 2023-03-01 20:00 +0100
Re: solution to / full Andy Smith <andy@strugglers.net> - 2023-03-01 21:00 +0100
Re: solution to / full David Wright <deblis@lionunicorn.co.uk> - 2023-03-02 00:30 +0100
Re: solution to / full songbird <songbird@anthive.com> - 2023-03-03 05:10 +0100
Re: solution to / full Richard Hector <richard@walnut.gen.nz> - 2023-03-03 07:50 +0100
Re: solution to / full David Christensen <dpchrist@holgerdanske.com> - 2023-03-01 22:00 +0100
Re: solution to / full Charles Curley <charlescurley@charlescurley.com> - 2023-03-01 22:30 +0100
Re: solution to / full Jonathan Dowland <jon+debian-user@dow.land> - 2023-03-02 10:40 +0100
Re: solution to / full Jeffrey Walton <noloader@gmail.com> - 2023-03-02 00:00 +0100
Re: solution to / full Felix Miata <mrmazda@earthlink.net> - 2023-03-02 00:10 +0100
Re: solution to / full Greg Wooledge <greg@wooledge.org> - 2023-03-02 00:20 +0100
Re: solution to / full <tomas@tuxteam.de> - 2023-03-02 06:50 +0100
Re: solution to / full lina <lina.lastname@gmail.com> - 2023-03-02 09:50 +0100
Re: solution to / full lina <lina.lastname@gmail.com> - 2023-03-02 10:00 +0100
Re: solution to / full <tomas@tuxteam.de> - 2023-03-02 10:20 +0100
Re: solution to / full David Christensen <dpchrist@holgerdanske.com> - 2023-03-02 23:50 +0100
Re: solution to / full David Christensen <dpchrist@holgerdanske.com> - 2023-03-02 23:50 +0100
Re: solution to / full Felix Miata <mrmazda@earthlink.net> - 2023-03-03 00:20 +0100
Re: solution to / full David Christensen <dpchrist@holgerdanske.com> - 2023-03-03 01:20 +0100
csiph-web