tech-userlevel archive

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

Convention in the output of service rcvar



Hello!
Consider a service whose start-up is controlled by a variable in
/etc/rc.conf:

food=YES

Then, the output of `service food rcvar' is:

# food
$food=YES

I wonder why this choice has been made, instead of

# food
food=YES

This second version would also reproduce the shell syntax. I do not know
sh(1) as deeply, but `$food=YES' maybe would not make sense. Of course,
this is just an output (and it is definitely clear), but it seems a
counterintuitive way to display it.

In FreeBSD, for example, the trailing `$' is absent.

In NetBSD, this is determined by this code in /etc/rc.subr:

rcvar)                  
        echo "# $name"  
        if [ -n "$rcvar" ]; then
                if checkyesno ${rcvar}; then 
                        echo "\$${rcvar}=YES"
                else    
                        echo "\$${rcvar}=NO"  
                fi
        fi              
        ;;

The trailing character `$' appears since the first revision where such a
mechanism has been implemented (rev=1.11).

Is there any reason for that? What do you think?

Bye!

Rocky


Home | Main Index | Thread Index | Old Index