# awk { while (match($0, /-$/)) { # Drop line continuation gsub(/-$/, "") # Print the line, without newline printf "%s", $0 # Get the next line, skipping blank lines do { getline } while($0==""); # Print the first word printf "%s\n", $1 # Drop the first word, remove leading whitespace $1="" sub(/^[ \t]+/, "") } print }