format

Bash printf %q

Prints a Bash-escaped representation of an argument. Exact representation can vary with version and locale.

Formal Syntax & Structure

bash syntaxbash
printf '%q\n' value

Return Value

behavior

See the syntax and description for shell interpretation or output.

Working Example

Example Snippetbash
printf '%q\n' 'daily report' '' '*'
Bash Reference