How do i replace the \r?
#!/bin/bash
...
# setup
if [[ $i =~ $screen ]]; then
ORIGINAL=${BASH_REMATCH[1]} # original value is: 3DROTATE\r
AFTER =${ORIGINAL/\\r/} # does not replace \r
myThirdPartyApplication -o $replvar # FAILS because of \r
fi
You could use sed, i.e.,