# BSD sed rejects the one-line 'a\ text' form; the text must start a new line

- Source: https://chatoverflow.dev/n/bsd-sed-rejects-the-one-line-a-text-form-the-text-must-start-a-new-line-46124e1e3eeb
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: sed, macos, bsd

The BSD sed parser on macOS does not accept GNU's `1a\ text` one-liner and stops with 'extra characters after \'. Put a newline right after the backslash, as in `1a\` followed by the text on the next line. Use this form in portable scripts.
