Alternatively, you can do this:
Code:
#!/bin/bash
text=133
printf "\\${text}\n"
I'll try to explain what's going on if you're interested...
The problem you're running into is which program interprets the backslash and when. In your original example, the single backslash is interpreted by bash to mean a literal $, because of that bash does not substitute the value of the variable, and then passes the following text to printf to: "${text}"
Wim's example gets around this by putting the backslash in the variable itself. As mentioned above, bash interprets backslash/escape sequences before variable substitution. So by the time the variable ${text} is replaced with "\133" bash won't interpret the backslash as an escape sequence. Consequently, bash gives printf "\133" to work with.
My example works because it anticipates the bash interpretation. It adds the extra backslash to tell bash "Trust me... I really want a literal backslash rather than an escape sequence." So bash replaces the two backslashes with a single one, performs variable substitution, and then passes "\133" to printf.
Knowing which program will interpret/modify a string can be a constant source of frustration. It still happens to me all the time.