If you did set -x
, echo alias elog=..
, alias elog
or otherwise got bash to write the result back to you, you'd see why it isn't working. \\
in double quotes becomes \
.
The rule of thumb is that if you have to ask, you've exceeded the usefulness of an alias. Use a function instead:
elog() {
tail -f /var/log/httpd/my-sandbox-error_log | sed -e 's/\\n/\n/g'
}
This way you don't need any additional escaping.