1

In order to understand the syntax of egrep -v ^'(#|$)' command, which only shows uncommented lines and doesn't display the blank lines I get using grep -v '^#', I created a test file with blank lines.

As I wanted to see their exact position I used less -N <file> command to find that it doesn't show all the blank lines. I then tried view <test file> / :set number and it was okay.

Is this normal less editor behavior or is there something wrong somewhere? Or is there a specific option?

Why view, all lines are shown:

~$ view <test file>
  1 
  2 #cob  less  #etc      
  3 
  4 
  5 
  6 trader   
  7 zip
  8 
  9 you
 10 #very

With less lines 4 and 5 are missing:

~$ less -N <test file>
      1
      2 #cob  less  #etc      
      3 
      6 trader   
      7 zip
      8 
      9 you
     10 #very
0

1 Answer 1

1

To customize the terminal display, a long time ago I added this line to the .bashrc file:

export LESS='-RM~gsw'. There is an s option which causes to squeeze consecutive blank lines:

man less
-s or --squeeze-blank-lines
Causes consecutive blank lines to be squeezed into  a  single  blank

It’s my mistake. I removed this s option and less editor behaves just like view editor.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .