On Sun 27 Apr 2008 at 12:54PM, Rinaldo DiGiorgio wrote:
> >> [EMAIL PROTECTED]:~# cat /etc/motd
> >> Sun Microsystems Inc. SunOS 5.11 snv_86 January 2008
> >> [EMAIL PROTECTED]:~# grep 11 /etc/motd
> >> Sun Microsystems Inc. SunOS 5.11 snv_86 January 2008
> >> [EMAIL PROTECTED]:~# echo $?
> >> 0
> >> [EMAIL PROTECTED]:~# grep 12 /etc/motd
> >> [EMAIL PROTECTED]:~# echo $?
> >> 1
> >>
> >
> > The analogy here isn't convincing, possibly because the pkg(1)
> > invocations above are a small subset of those available. pkg
> > uninstall of an unknown package gives a non-zero exit status; pkg
> > install of an unknown package gives a non-zero exit status. At the
> > completion of the pkg install invocation in both the cases above, the
> > requested package is actually installed.
Rinaldo,
A similar command that you might use to make this test is
'pkg list <pkgname>' -- this does indeed return 1 if the package
is not installed. I think that's the most analogous to grep, and
is the test we use in the test suite for this kind of checking.
-dp
--
Daniel Price - Solaris Kernel Engineering - [EMAIL PROTECTED] - blogs.sun.com/dp
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss