SOURCES: motion.init - optimize grep,grep,head,awk->awk

glen glen at pld-linux.org
Sun Dec 10 13:38:40 CET 2006


Author: glen                         Date: Sun Dec 10 12:38:40 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- optimize grep,grep,head,awk->awk

---- Files affected:
SOURCES:
   motion.init (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/motion.init
diff -u SOURCES/motion.init:1.5 SOURCES/motion.init:1.6
--- SOURCES/motion.init:1.5	Sun Dec 10 13:36:37 2006
+++ SOURCES/motion.init	Sun Dec 10 13:38:34 2006
@@ -24,7 +24,7 @@
 		daemon --user motion ${motion} ${STARTUP_OPTIONS}
 		RETVAL=$?
 		if [ $RETVAL -eq 0 ] ; then
-			echo `ps axf | grep -v grep | grep ${motion} | head -n1 | awk '{print $1}'` > ${PIDFILE}
+			echo `ps axf | awk "!/awk/ && /$motion/{print \$1; exit}"` > ${PIDFILE}
 			touch /var/lock/subsys/motion
 		fi
 	else
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/motion.init?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list