Source-Changes-HG archive

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

[src/trunk]: src/etc run_rc_command - don't prefix the rcvar variable name wi...



details:   https://anonhg.NetBSD.org/src/rev/a8c648376566
branches:  trunk
changeset: 948215:a8c648376566
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Dec 20 21:30:28 2020 +0000

description:
run_rc_command - don't prefix the rcvar variable name with the dollar sign.

The output without the dollar sign is less confusing as it's actual
valid shell syntax:

  $ /etc/rc.d/foo rcvar
  # food
  food=YES

Brought up on tech-userlevel@ by Rocky Hotas with some LGTMs from
other people and no objections.

We still refer to '$food' in warnings/errors though.

diffstat:

 etc/rc.subr |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r c241b66f7342 -r a8c648376566 etc/rc.subr
--- a/etc/rc.subr       Sun Dec 20 21:07:32 2020 +0000
+++ b/etc/rc.subr       Sun Dec 20 21:30:28 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.105 2020/09/17 20:29:03 otis Exp $
+# $NetBSD: rc.subr,v 1.106 2020/12/20 21:30:28 uwe Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -822,9 +822,9 @@
                        echo "# $name"
                        if [ -n "$rcvar" ]; then
                                if checkyesno ${rcvar}; then
-                                       echo "\$${rcvar}=YES"
+                                       echo "${rcvar}=YES"
                                else
-                                       echo "\$${rcvar}=NO"
+                                       echo "${rcvar}=NO"
                                fi
                        fi
                        ;;



Home | Main Index | Thread Index | Old Index