Consider the following bash script
#!/usr/bin/env bash
tstring="Hi\tThere"
istring=$(echo -e $tstring)
echo $istring # Prints: Hi There
rstring=$(printf '%q' "$istring") # This is not doing what I intended
echo $rstring # Prints: $'Hi\tThere'
I want rstring to be the same as tstring so that I can test for equality. So basically how do I undo the operation that created istring and get back tstring?