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

teamcity Automatic Agent Start under Linux

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