[nycbug-talk] pkg_info

Marc Spitzer mspitze1
Mon Feb 23 18:53:12 EST 2004


On Mon, 23 Feb 2004 18:50:32 -0500
Jan Schaumann <jschauma at netmeister.org> wrote:

> Marc Spitzer <mspitze1 at optonline.net> wrote:
>  
> > pkg_info |awk '{print $1}'
> 
> pkg_info | cut -d' ' -f1
> pkg_info | sed -e 's/\(^[^ ]*\).*/\1/'
> 
> But 'ls /var/db/pkg' and 'pkg_info -e '*'' are faster than the three
> above (and speed sure counts in this instance, n'est-ce pas?).

I said cut works but it will *only* work on the first column for
pkg_info output.  And I always found sed weird.

> 
> And for extra-credit, if you hosed your system and can't use either
> pkg_info or ls, you can let the shell do it all for you:

If your system is that hosed you have bigger problems

marc

> 
> cd /var/db/pkg
> echo *
> 
> -Jan
> 
> -- 
> I always said there was something fundamentally wrong with the
> universe.
> 




More information about the talk mailing list