From owner-svn-src-head@freebsd.org Tue Dec 13 21:24:38 2016 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 9E3EAC76E09; Tue, 13 Dec 2016 21:24:38 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DAB1FF8; Tue, 13 Dec 2016 21:24:38 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id B5B4C41F5; Tue, 13 Dec 2016 22:24:35 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id A4C6128494; Tue, 13 Dec 2016 22:24:35 +0100 (CET) Date: Tue, 13 Dec 2016 22:24:35 +0100 From: Jilles Tjoelker To: Devin Teske Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309918 - head/usr.sbin/bsdinstall/scripts Message-ID: <20161213212435.GA34587@stack.nl> References: <201612121848.uBCIm00M073404@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612121848.uBCIm00M073404@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Tue, 13 Dec 2016 21:24:38 -0000 On Mon, Dec 12, 2016 at 06:48:00PM +0000, Devin Teske wrote: > Author: dteske > Date: Mon Dec 12 18:48:00 2016 > New Revision: 309918 > URL: https://svnweb.freebsd.org/changeset/base/309918 > Log: > Remove unnecessary `-n' parameter to head/tail These -n options are not completely unnecessary since POSIX removed the obsolete forms without -n years ago, and some minimalistic implementations (Busybox) followed suit. Therefore, although I use the obsolete forms frequently interactively, I think head/tail -n should be the preferred form in scripts. The obsolete form tail +N (where N is a number) should definitely be avoided since it conflicts with a file named like that; head -N and tail -N are valid extensions to the standard. > Modified: > head/usr.sbin/bsdinstall/scripts/wlanconfig > > Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:45:52 2016 (r309917) > +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Mon Dec 12 18:48:00 2016 (r309918) > @@ -175,8 +175,8 @@ fi > # > if [ "$BSDINSTALL_CONFIGCURRENT" ]; then > # Get current country/regdomain for selected interface > - WLAN_IFACE=$( wpa_cli ifname | tail -n 1 ) > - INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -n 1 ) > + WLAN_IFACE=$( wpa_cli ifname | tail -1 ) > + INPUT=$( ifconfig $WLAN_IFACE list regdomain | head -1 ) > DEF_REGDOMAIN=$( echo $INPUT | cut -w -f 2 ) > DEF_COUNTRY=$( echo $INPUT | cut -w -f 4 ) > [ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="" -- Jilles Tjoelker