tseeling·13 ปีที่แล้ว·discussI always cringe when I see shell code like this > cat /etc/passwd | cut -f1 -d:Usually this comes as > ps -ef | grep something | grep -v grep | grep -v $myownpidwhy not use one simple and concise awk statement which does it all in one go?awk -F: '{print$1}' /etc/passwd ps -ef | awk '/[h]ttpd/{print$2}'But apart from that: very nice summary of things to consider and the sequence for analysis.
Usually this comes as > ps -ef | grep something | grep -v grep | grep -v $myownpid
why not use one simple and concise awk statement which does it all in one go?
awk -F: '{print$1}' /etc/passwd ps -ef | awk '/[h]ttpd/{print$2}'
But apart from that: very nice summary of things to consider and the sequence for analysis.