How to check that if a package is installed?

Hal Burgiss hal at burgiss.net
Tue Nov 30 14:15:15 UTC 2010


On Tue, Nov 30, 2010 at 7:54 AM, S Mathias <smathias1972 at yahoo.com> wrote:

> if [ "$(dpkg -l | awk '/tofrodos/ && /^ii/ {print $2}' | awk
> '/^tofrodos/')" == "" ]; then echo -e "error: no zip package
> detected\!\n\nYou could install it like e.g.: \"apt-get install tofrodos\"";
> fi
>
> Is there a better way then this?
>
>
Seems kind of wordy to me for what it really does ...

dpkg -l |grep torfrodos || echo nope


-- 
Hal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20101130/33485a0a/attachment.html>


More information about the ubuntu-users mailing list