[tz] [PROPOSED 2/3] Avoid sed in tzselect

Paul Eggert eggert at cs.ucla.edu
Tue Jan 2 22:08:23 UTC 2024


* tzselect.ksh: Rewrite to not use the sed command.
It’s used only in one place, and awk can do it;
this removes a dependency of tzselect on sed.
---
 tzselect.ksh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tzselect.ksh b/tzselect.ksh
index cc58db03..8e66b30d 100644
--- a/tzselect.ksh
+++ b/tzselect.ksh
@@ -511,7 +511,7 @@ while
 	  "$output_distances_or_times" \
 	  ="$coord" ="$TZ_COUNTRY_TABLE" ="$TZ_ZONE_TABLE" |
 	sort -n |
-	sed "${location_limit}q"
+	$AWK "{print} NR == $location_limit { exit }"
       `
       regions=`
 	$AWK '
-- 
2.40.1




More information about the tz mailing list