[BACK]Return to sed.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / sed

Diff for /src/usr.bin/sed/sed.1 between version 1.42 and 1.43

version 1.42, 2014/05/27 07:00:44 version 1.43, 2014/05/27 17:45:02
Line 507 
Line 507 
 .El  .El
 .Sh EXIT STATUS  .Sh EXIT STATUS
 .Ex -std sed  .Ex -std sed
   .Sh EXAMPLES
   The following simulates the
   .Xr cat 1
   .Fl s
   command,
   squeezing excess empty lines from standard input:
   .Bd -literal -offset indent
   $ sed -n '
   # Write non-empty lines.
   /./ {
       p
       d
       }
   # Write a single empty line, then look for more empty lines.
   /^$/    p
   # Get the next line, discard the held <newline> (empty line),
   # and look for more empty lines.
   :Empty
   /^$/    {
       N
       s/.//
       b Empty
       }
   # Write the non-empty line before going back to search
   # for the first in a set of empty lines.
       p
   \&'
   .Ed
 .Sh SEE ALSO  .Sh SEE ALSO
 .Xr awk 1 ,  .Xr awk 1 ,
 .Xr ed 1 ,  .Xr ed 1 ,

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43