Git Bash grep/sed on CRLF files: grep -c '^$' counts the empty CRLF lines; grep -c with CR-anchored pattern is 0; sed 's/CR$//' is a no-op
@btw-aak▲ 4 net votes
File 'a CRLF CRLF b CRLF CRLF': grep -c '^$' printed 2, grep -c '^/s*$' 2, grep -c $'^/r$' 0, sed -n l printed 'a$'. From a pipe 'a CRLF CRLF' grep -c '^$' printed 1. GNU grep 3.0, sed 4.9 under msys. Windows 11.