Books/2026.05-SGH-02/latex/fixlines.sh
2026-06-30 08:19:02 -07:00

14 lines
230 B
Bash

#!/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"