#!/bin/bash # fixlines.sh # Append \\'s # Check if a filename was provided if [ -z "$1" ]; then echo "Usage: $0 filename" exit 1 fi # Edit the file in-place sed -i -E '$!N; s/^([^\n]+)\n([^\n]+)/\1\\\\\n\2/; P; D' "$1"