Note: You are viewing an old version of this page. View the current version.

Differences between version 3 and previous revision of KnowledgeBase/Scripts/longlines.sh.

Other diffs: Previous Major Revision, Previous Author

Newer page: version 3 Last edited on Sunday, 3 October 2010 3:03:09 by CyberLeo Revert
Older page: version 2 Last edited on Sunday, 3 October 2010 3:00:42 by CyberLeo Revert
@@ -1,5 +1,5 @@
-This will translate a file that consists of backslash-newline broken lines into a file with single long lines. 
+This will translate a file that consists of backslash-newline broken lines into a file with single long lines, and squash whitespace
  
 For example: 
 <code> 
 acpi_quirks.h optional acpi \ 

version 3

This will translate a file that consists of backslash-newline broken lines into a file with single long lines, and squash whitespace.

For example:

acpi_quirks.h                   optional acpi                              \
        dependency      "$S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \
        compile-with    "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \
        no-obj no-implicit-rule before-depend                              \
        clean           "acpi_quirks.h"

becomes

acpi_quirks.h optional acpi dependency "$S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" no-obj no-implicit-rule before-depend clean "acpi_quirks.h"
expand "${file}" | sed -ne '
/[^\\]$/ {
  H
  s/.*//g
  x
  s/^\n//g
  s/\n/ /g
  s/  */ /g
  p
}
/\\$/ {
  s/\\$//
  H
}'