Subject: Re: rcvar don't display dollar sign
To: Jeremy C. Reed <reed@reedmedia.net>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-userlevel
Date: 07/01/2005 12:29:00
--yVhtmJPUSI46BTXb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 28, 2005 at 12:04:24AM -0700, Jeremy C. Reed wrote:
  | Can we have rc.subr not print a dollar sign with rcvar output?
  |=20
  | I notice it is confusing to some students in some of my (FreeBSD) class=
es.
  |=20
  | Is it needed?
  |=20
  | --- etc/rc.subr	12 Oct 2004 14:45:29 -0000	1.65
  | +++ etc/rc.subr	28 Jun 2005 07:00:10 -0000
  | @@ -64,7 +64,7 @@
  |  		return 1
  |  		;;
  |  	*)
  | -		warn "\$${1} is not set properly - see ${rcvar_manpage}."
  | +		warn "${1} is not set properly - see ${rcvar_manpage}."

If we make this change, please quote the variable in the message;
something like:
	warn "'${1}' is not set properly - see ${rcvar_manpage}."
which will display as
sh: WARNING: 'jeremy' is not set properly - see rc.conf(5).



  |  		return 1
  |  		;;
  |  	esac
  | @@ -671,9 +671,9 @@
  |  			echo "# $name"
  |  			if [ -n "$rcvar" ]; then
  |  				if checkyesno ${rcvar}; then
  | -					echo "\$${rcvar}=3DYES"
  | +					echo "${rcvar}=3DYES"
  |  				else
  | -					echo "\$${rcvar}=3DNO"
  | +					echo "${rcvar}=3DNO"
  |  				fi
  |  			fi
  |  			;;

Scripts may depend upon the current behaviour so that they
can eval the output.  Making your suggested change would break them.
Thus, I'm not convinced that this part of the proposal is acceptable.


Cheers,
Luke.

--yVhtmJPUSI46BTXb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFCxKpspBhtmn8zJHIRAjfxAJ9W07XLmSzQM1RsSFJpHsNdi4oKpgCfcFM1
T++BFwpdEZjb0inNGXize+Y=
=5Wd6
-----END PGP SIGNATURE-----

--yVhtmJPUSI46BTXb--