Reputation
29,284
Next tag badge:
460/400 score
71/80 answers
Badges
6 68 112
Newest
 linux
Impact
~1.9m people reached

Feb
5
awarded  linux
Feb
4
awarded  Revival
Feb
3
awarded  Enlightened
Feb
3
awarded  Nice Answer
Jan
31
awarded  Yearling
Jan
20
awarded  Nice Question
Jan
19
awarded  Great Answer
Dec
21
awarded  Guru
Dec
16
awarded  networking
Dec
6
awarded  Nice Answer
Nov
24
awarded  Good Question
Nov
17
awarded  Guru
Nov
8
comment How to escape special characters in a string?
As i've said several times now. Not knowing how how to pass raw data to the shell isn't an issue with printf. Perhaps you should ask a question rather than critiquing a solution that has nothing to do with your problem.
Nov
8
comment How to escape special characters in a string?
Your issue has nothing to do with printf. Your issue is that you don't want the shell to parse your string. In order to do that, you have to pass your input to the shell in a way where it doesn't even try to parse it. One way to do this would be read -r -p 'input: ' && printf '%q\n' "$REPLY", and provide the input when prompted.
Nov
7
comment How to escape special characters in a string?
@user3467349 it works just fine with quotes. I'm betting you're trying something like printf '%s' "foo". You need to understand how argument parsing works in the shell first. See gnu.org/software/bash/manual/bash.html#Shell-Operation #2 happens before #6.
Oct
29
awarded  Enlightened
Oct
29
awarded  Nice Answer
Oct
27
awarded  Nice Answer
Oct
27
awarded  Good Answer
Oct
9
awarded  Enlightened