Delete blank lines: awk NF | skip the header and find the sum of col #4 program | awk 'NR>1{i+=$4}END{print i}'

Delete blank lines:
[root@localhost tmp]# cat /tmp/file
werwerewr

werwerwe
ewrwer

erwer
[root@localhost tmp]# cat /tmp/file | awk NF
werwerewr
werwerwe
ewrwer
erwer
===============
skip the header row and find the sum of column #4
program | awk 'NR>1{i+=$4}END{print i}'

Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all