Last active
December 20, 2020 01:05
-
-
Save bahamat/7c4abade72d674e34281 to your computer and use it in GitHub Desktop.
Magical quoting with printf %q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo quote what? ; read quoteme ; printf %q "$quoteme" ; echo | |
quote what? | |
The horse said "$)#*@(!!%" when he stubbed his hoof. | |
The\ horse\ said\ \"\$\)#\*@\(\!\!%\"\ when\ he\ stubbed\ his\ hoof. | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment