[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Way to check installed daemon



On Thu, Apr 19, 2001 at 09:41:58PM -0700, Osamu Aoki wrote:
> 
> dpkg -s lprng| grep -e "^Status: install ok installed"
> dpkg -s lpr|   grep -e "^Status: install ok installed"
> 
> It will be very slow, though.  Any good way?

how about replacing dpkg -s lprng with
grep -A1 '^Package: lpr$' /var/lib/dpkg/status

and grep -e "^Status: install ok installed" with
grep -q -e "^Status: install ok installed"
(helps in suppressing unnecessary output)

comparison times:
dpkg -s lpr  5.71s user 0.37s system 35% cpu 17.182 total
grep -A1 '^Package: lpr$' /var/lib/dpkg/status  0.00s user 0.04s system 155% cpu 0.026 total

-john



Reply to: