Skip to main content
cat $file | egrep -v '^;|^$' $file 

that will exclude lines that begin with the ';', and empty lines.

in regex, ^ indicates the beginning of a line, and $ the end of a line, so ^$ specifies lines where the start of line character and the end of line character are right next to each other.

cat $file | egrep -v '^;|^$' 

that will exclude lines that begin with the ';', and empty lines.

in regex, ^ indicates the beginning of a line, and $ the end of a line, so ^$ specifies lines where the start of line character and the end of line character are right next to each other.

egrep -v '^;|^$' $file 

that will exclude lines that begin with the ';', and empty lines.

in regex, ^ indicates the beginning of a line, and $ the end of a line, so ^$ specifies lines where the start of line character and the end of line character are right next to each other.

Source Link
Tim Kennedy
  • 20.2k
  • 5
  • 42
  • 58

cat $file | egrep -v '^;|^$' 

that will exclude lines that begin with the ';', and empty lines.

in regex, ^ indicates the beginning of a line, and $ the end of a line, so ^$ specifies lines where the start of line character and the end of line character are right next to each other.