initscripts: avoid pipe with sed
authorMatthieu Crapet <Matthieu.Crapet@ingenico.com>
Tue, 6 May 2014 12:17:52 +0000 (14:17 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 May 2014 12:00:33 +0000 (13:00 +0100)
Small optimisation in /etc/init.d/populate-volatile.sh.

Replace:
cat <file> | sed -e xxx
By:
sed -e xxx <file>

(From OE-Core rev: c91739cd08ed5451a0927586a14db54c4c328ad7)

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh

index 6ffe1f2..e707b20 100755 (executable)
@@ -106,7 +106,7 @@ check_requirements() {
        TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
        TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
 
-       cat ${ROOT_DIR}/etc/passwd | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
+       sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq > "${TMP_DEFINED}"
        cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
        cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
        NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
@@ -120,7 +120,7 @@ check_requirements() {
        }
 
 
-       cat ${ROOT_DIR}/etc/group | sed 's@\(^:\)*:.*@\1@' | sort | uniq > "${TMP_DEFINED}"
+       sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq > "${TMP_DEFINED}"
        cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
        cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"