Does anyone have any opinions on these new options for svcprop?

     -1         Can only be used with arguments which specify
                a single property.  If the property has a single
                value, then it is printed, without quotation.  If
                the property has no values or multiple values,
                then svcprop will print nothing and exit with
                status 3.

     -T type    Can only be used with the -1 option.  If the
                specified property has a type other than _type_
                or a subtype of _type_, svcprop will print
                nothing and exit with status 4.

This is meant to make it easier for scripts to use svcprop:

        val=`svcprop -1 -T astring -p pg/prop service`
        case $? in
            0)  ;;
            2)  echo "Programmer error." >&2
                exit 1
                ;;
            3)  echo "pg/prop has no values or multiple values; \c" >&2
                echo "using default." >&2
                val=default
                ;;
            4)  echo "pg/prop has wrong type; using default." >&2
                val=default
                ;;
            *)  echo "Could not get value of pg/prop; using default." >&2
                val=default
                ;;
        esac

Hmm, I wonder if we should also allow svcprop with no operands, which
would automatically use scf_myname() to determine the current service.


David

Reply via email to