From owner-svn-src-head@freebsd.org Wed Sep 2 21:53:49 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78AE89C8C38; Wed, 2 Sep 2015 21:53:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D12114E5; Wed, 2 Sep 2015 21:53:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t82LrnOd049646; Wed, 2 Sep 2015 21:53:49 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t82LrnOJ049645; Wed, 2 Sep 2015 21:53:49 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201509022153.t82LrnOJ049645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 2 Sep 2015 21:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287413 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2015 21:53:49 -0000 Author: dteske Date: Wed Sep 2 21:53:48 2015 New Revision: 287413 URL: https://svnweb.freebsd.org/changeset/base/287413 Log: Minor code cleanups (no functional changes). MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Wed Sep 2 21:13:06 2015 (r287412) +++ head/usr.sbin/sysrc/sysrc Wed Sep 2 21:53:48 2015 (r287413) @@ -257,14 +257,14 @@ while getopts aAcdDef:Fhij:nNqR:vxX flag F) SHOW_FILE=1 ;; h) usage ;; # NOTREACHED i) IGNORE_UNKNOWNS=1 ;; - j) [ "$OPTARG" ] || die \ - "%s: Missing or null argument to \`-j' flag" "$pgm" + j) [ "$OPTARG" ] || + die "%s: Missing or null argument to \`-j' flag" "$pgm" JAIL="$OPTARG" ;; n) SHOW_NAME= ;; N) SHOW_VALUE= ;; q) QUIET=1 VERBOSE= ;; - R) [ "$OPTARG" ] || die \ - "%s: Missing or null argument to \`-R' flag" "$pgm" + R) [ "$OPTARG" ] || + die "%s: Missing or null argument to \`-R' flag" "$pgm" ROOTDIR="$OPTARG" ;; v) VERBOSE=1 QUIET= ;; x) DELETE=${DELETE:-1} ;; @@ -384,13 +384,12 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then # jls(1) or jexec(8) utilities are missing. # if f_have jexec && f_have jls; then - jid="`jls jid path | \ - ( + jid=$( jls jid path | while read JID JROOT; do [ "$JROOT" = "$ROOTDIR" ] || continue echo $JID done - )`" + ) # # If multiple running jails match the specified root @@ -472,8 +471,8 @@ if [ "$SHOW_ALL" ]; then # If passed `-a' (rather than `-A'), re-purge the # environment, removing the rc.conf(5) defaults. # - [ "$SHOW_ALL" = "1" ] \ - && f_clean_env --except rc_conf_files $EXCEPT + [ "$SHOW_ALL" = "1" ] && + f_clean_env --except rc_conf_files $EXCEPT # # If `-f file' was passed, set $rc_conf_files to an @@ -491,8 +490,7 @@ if [ "$SHOW_ALL" ]; then # [ "$SHOW_ALL" = "1" -a \ "$( f_sysrc_find rc_conf_files )" = "$RC_DEFAULTS" \ - ] \ - && unset rc_conf_files + ] && unset rc_conf_files fi for NAME in $( set | @@ -524,7 +522,7 @@ if [ "$SHOW_ALL" ]; then continue fi - [ "$VERBOSE" ] && \ + [ "$VERBOSE" ] && echo -n "$( f_sysrc_find "$NAME" ): " # @@ -560,7 +558,7 @@ while [ $# -gt 0 ]; do *) mode=ASSIGN esac - [ "$DESCRIBE" ] && \ + [ "$DESCRIBE" ] && echo "$NAME: $( f_sysrc_desc "$NAME" )" case "$1" in @@ -573,7 +571,7 @@ while [ $# -gt 0 ]; do # If verbose, prefix line with where the directive lives if [ "$VERBOSE" -a ! "$CHECK_ONLY" ]; then file=$( f_sysrc_find "$NAME" ) - [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && \ + [ "$file" = "$RC_DEFAULTS" -o ! "$file" ] && file=$( f_sysrc_get 'rc_conf_files%%[$IFS]*' ) if [ "$SHOW_EQUALS" ]; then echo -n ": $file; "