From adff51b1e29d5eb23e90404239c43bb7644f0fb2 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 10 Nov 2014 23:06:40 -0500 Subject: installers/pc: Combine sed and head commands --- (limited to 'installers') diff --git a/installers/pc.sh b/installers/pc.sh index cc42a25..bd83df7 100755 --- a/installers/pc.sh +++ b/installers/pc.sh @@ -63,8 +63,9 @@ main() ${mirror:+-m} ${mirror} "${mountpoint}" mirror="$(printf '%s\n' "${mirror}" | \ sed 's|^.*://||; s|^.*@||; s|/.*$||g;')" - printf '%s %s\n' "$(nslookup "${mirror}" | sed -n 's/Address: //p' | \ - head -n 1)" "${mirror}" >"${mountpoint}/etc/hosts" + printf '%s %s\n' "$(nslookup "${mirror}" | \ + sed -n '/Address: /{ s/Address: //; p; q; };')" \ + "${mirror}" >"${mountpoint}/etc/hosts" "${0%installers/pc.sh}./miniprokit.sh" shell "${mountpoint}" \ <"${0%pc.sh}data/pc.sh" rm "${mountpoint}/etc/hosts" -- cgit v0.9.1