format

Bash printf %b

Interprets supported backslash escapes in the argument. Use %s when data should stay literal.

Formal Syntax & Structure

bash syntaxbash
printf '%b\n' value

Return Value

behavior

See the syntax and description for shell interpretation or output.

Working Example

Example Snippetbash
message='A\nB'printf '%s\n' "$message"printf '%b\n' "$message"
Bash Reference