diff options
author | dteske <dteske@FreeBSD.org> | 2012-09-22 04:04:02 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2012-09-22 04:04:02 +0000 |
commit | a74ee85809555d43ba3be70a6f33a037fc22d53e (patch) | |
tree | 375d9c5184db5178dff9a7ac6c97c23ecb5cb73d /usr.sbin/bsdconfig | |
parent | 0552e7d2c38b816d8d506944d5f258ae1b5cd38d (diff) | |
download | FreeBSD-src-a74ee85809555d43ba3be70a6f33a037fc22d53e.zip FreeBSD-src-a74ee85809555d43ba3be70a6f33a037fc22d53e.tar.gz |
Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax.
Reviewed by: jilles, adrian (co-mentor)
Approved by: jilles, adrian (co-mentor)
Diffstat (limited to 'usr.sbin/bsdconfig')
-rw-r--r-- | usr.sbin/bsdconfig/share/sysrc.subr | 8 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcadd | 2 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcconf | 2 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcdelete | 4 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcvar | 2 |
5 files changed, 7 insertions, 11 deletions
diff --git a/usr.sbin/bsdconfig/share/sysrc.subr b/usr.sbin/bsdconfig/share/sysrc.subr index 80deaa8..51aabcc 100644 --- a/usr.sbin/bsdconfig/share/sysrc.subr +++ b/usr.sbin/bsdconfig/share/sysrc.subr @@ -132,7 +132,7 @@ f_sysrc_get() # Clear the environment of all variables, preventing the # expansion of normals such as `PS1', `TERM', etc. # - f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS + f_clean_env --except RC_CONFS RC_DEFAULTS . "$RC_DEFAULTS" > /dev/null 2>&1 @@ -153,15 +153,11 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 - if [ $? -eq ${SUCCESS:-0} ]; then + if [ "${RC_CONFS+set}" ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 fi - unset SUCCESS - # no longer needed - source_rc_confs > /dev/null 2>&1 # diff --git a/usr.sbin/bsdconfig/startup/rcadd b/usr.sbin/bsdconfig/startup/rcadd index d9d6a04..8f28840 100755 --- a/usr.sbin/bsdconfig/startup/rcadd +++ b/usr.sbin/bsdconfig/startup/rcadd @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 ############################################################ FUNCTIONS diff --git a/usr.sbin/bsdconfig/startup/rcconf b/usr.sbin/bsdconfig/startup/rcconf index 3f7c250..4fb5859 100755 --- a/usr.sbin/bsdconfig/startup/rcconf +++ b/usr.sbin/bsdconfig/startup/rcconf @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 diff --git a/usr.sbin/bsdconfig/startup/rcdelete b/usr.sbin/bsdconfig/startup/rcdelete index a970258..b431d88 100755 --- a/usr.sbin/bsdconfig/startup/rcdelete +++ b/usr.sbin/bsdconfig/startup/rcdelete @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then + if eval [ \"\${_${var}_delete+set}\" ]; then unset _${var}_delete else setvar _${var}_delete 1 diff --git a/usr.sbin/bsdconfig/startup/rcvar b/usr.sbin/bsdconfig/startup/rcvar index 799dd34..b7a5229 100755 --- a/usr.sbin/bsdconfig/startup/rcvar +++ b/usr.sbin/bsdconfig/startup/rcvar @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 ############################################################ FUNCTIONS |