Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Feb 2015 20:24:40 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Devin Teske <dteske@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r278467 - head/usr.sbin/bsdconfig/share
Message-ID:  <20150209192440.GL29891@ivaldir.etoilebsd.net>
In-Reply-To: <201502091916.t19JGJcO061055@svn.freebsd.org>
References:  <201502091916.t19JGJcO061055@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Mon, Feb 09, 2015 at 07:16:19PM +0000, Devin Teske wrote:
> Author: dteske
> Date: Mon Feb  9 19:16:19 2015
> New Revision: 278467
> URL: https://svnweb.freebsd.org/changeset/base/278467
> 
> Log:
>   Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
>   
>   MFC after:	3 days
> 
> Modified:
>   head/usr.sbin/bsdconfig/share/keymap.subr
> 
> Modified: head/usr.sbin/bsdconfig/share/keymap.subr
> ==============================================================================
> --- head/usr.sbin/bsdconfig/share/keymap.subr	Mon Feb  9 17:53:16 2015	(r278466)
> +++ head/usr.sbin/bsdconfig/share/keymap.subr	Mon Feb  9 19:16:19 2015	(r278467)
> @@ -219,7 +219,7 @@ f_keymap_get_all()
>  			echo -n "$k "
>  			# NOTE: Translate '8x8' to '8x08' before sending to
>  			# sort(1) so that things work out as we might expect.
> -			debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
> +			debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
>  		done | sort -k2 | awk '{
>  			printf "%s%s", (started ? " " : ""), $1; started = 1
>  		}'

Out of curiosity what is the point of preferring awk over sed? the awk binary
being larger and depending on 2 libraries versus sed only depending on one?

Best regards,
Bapt

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlTZCXgACgkQ8kTtMUmk6EyOJACgjY6q9gMxurf/We39qh9NaglW
SNYAoLJpxSASyEcv6T8QY1cVRJu7jt3y
=o4o2
-----END PGP SIGNATURE-----

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