Patchwork [5/7] sysvinit-inittab: avoid pipe with grep

login
register
mail settings
Submitter Matthieu CRAPET
Date May 6, 2014, 12:17 p.m.
Message ID <1399378673-32040-5-git-send-email-Matthieu.Crapet@ingenico.com>
Download mbox | patch
Permalink /patch/71595/
State Accepted
Commit 1150ef1879ac66776296c8f738bf4aa5cb735f54
Headers show

Comments

Matthieu CRAPET - May 6, 2014, 12:17 p.m.
Replace:
cat <file> | grep xxx
By:
grep xxx <file>

Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
---
 meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
index 30641da..c3244b4 100644
--- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -54,7 +54,7 @@  if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
 	for i in $tmp
 	do
 		j=`echo ${i} | sed s/^.*\;//g`
-		if [ -z "`cat /proc/consoles | grep ${j}`" ]; then
+		if [ -z "`grep ${j} /proc/consoles`" ]; then
 			sed -i /^.*${j}$/d /etc/inittab
 		fi
 	done