Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Dec 2016 21:16:37 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r309946 - head/usr.sbin/bsdinstall/scripts
Message-ID:  <201612122116.uBCLGbVV037380@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Mon Dec 12 21:16:37 2016
New Revision: 309946
URL: https://svnweb.freebsd.org/changeset/base/309946

Log:
  Use awk the following (more succinct) awk syntax:
  
  	condition1 { action1 }
  	condition2 { action2 }
  
  instead of the following syntax:
  
  	{
  		if (condition1) { action1 }
  		else if (condition2) { action2 }
  	}

Modified:
  head/usr.sbin/bsdinstall/scripts/wlanconfig

Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:11:55 2016	(r309945)
+++ head/usr.sbin/bsdinstall/scripts/wlanconfig	Mon Dec 12 21:16:37 2016	(r309946)
@@ -317,13 +317,9 @@ elif echo $ENCRYPTION | grep -q EAP; the
 		scan_ssid=$SCANSSID
 		key_mgmt=WPA-EAP$(
 		echo "$USERPASS" | awk '
-		{
-			if (NR == 1) {
-				printf "	identity=\"%s\"\n", $1;
-			} else if (NR == 2) {
-				printf "	password=\"%s\"\n", $1;
-			}
-		}' )
+			NR == 1 { printf "\n\t\tidentity=\"%s\"", $1; }
+			NR == 2 { printf "\n\t\tpassword=\"%s\"", $1; }
+		' )
 		priority=5
 	}
 	EOF



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612122116.uBCLGbVV037380>