← Pablobot

Shell escape

Paste any string → copy a single-quoted literal safe for your shell.

Bash: wrap segments in '…' and escape embedded apostrophes as '\''. Not identical to GNU printf %q for every exotic byte.

ANSI-C: for odd control bytes, Bash allows $'line\n'; zsh/fish differ — not covered in this v1 page.

Snippet normalizes pasted CRLF to LF. Ensure the pasted body cannot include a solitary line identical to your delimiter terminator — Bash would end early.