(TIL) Nix: Combine multiple consecutive blank lines into one

less than 1 minute read

cat --squeeze-blank (or cat -s for short) will suppress repeated empty output lines.

$ echo  -e "abc


def" | cat
abc


def
$ echo  -e "abc


def" | cat -s
abc

def

Via UnixToolTip.

Tags: ,

Categories:

Updated:

Comments