You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

remove-comments.sed 284 B

4 vuotta sitten
1234567891011
  1. # Deletes comments and collapses whitespace in ##-packages files
  2. # Append (N)ext line to buffer
  3. # if (!)not ($)buffer is EOF, (b)ranch to (:)label loop
  4. :loop
  5. N
  6. $ !b loop
  7. # Buffer is "line1\nline2\n...lineN", del comments and collapse whitespace
  8. s/#[^\n]*//g
  9. s/[[:space:]]\{1,\}/ /g