When I execute the command screen -S myscreen -X stuff $'search add $1 \015' from a shell it works perfectly. If I put it in a .sh file and run it as sh /test.sh variablehere it sends it to screen as $'search add variablehere'.
Why would it normally work but not from sh? Im on Ubuntu Server if it matters.