Oct-07-2019, 03:39 PM
(Oct-07-2019, 02:16 PM)Gribouillis Wrote: Can you explain what the sed command does exactly here?
searches for a line that starts with Switch
Quote:sed /^Switch/
through an empty line
Quote:sed /^Switch/,/^$/
do not delete the match / deletes everything but the match
Quote:sed /^Switch/,/^$/!d
from the log called xxx.log
Quote:sed /^Switch/,/^$/!d xxx.log
grep just counts start of lines
Quote:sed /^Switch/,/^$/!d xxx.log | grep -c "^"
Thanks
SUM