Must have typo’d which mail before, Gnu mail is actually installed. I’d still prefer sendmail though since that’s what I use in all my scripts (for portability funny enough).
Wait, can Gnu mail even send anything externally? Idk, I’ll figure it out later.
Also just found the --grep= option in journalctl man page and thought, “hey, don’t have to pipe to grep, small win,” but alas…
Compiled without pattern matching support
That appears to be the case on Ubuntu as well, so maybe that’s normal? Funny that someone decided pattern matching was just one dependency too many for systemd… gotta draw the line somewhere I guess.
So ran into a weird issue using sed to replace single quotes in a string.
This appeared to work great with everything except a single quote, in which case, it would append the replacement string to the end. No error code or anything.
$ ILLEGAL_CHAR="'"
$ OCTAL=00047
$ echo "My Family's Vacation" | sed "s/\\${ILLEGAL_CHAR}/\[${OCTAL}\]/g"
My Family's Vacation[00047]
If I don’t escape the character variable, it works:
$ ILLEGAL_CHAR="'"
$ OCTAL=00047
$ echo "My Family's Vacation" | sed "s/${ILLEGAL_CHAR}/\[${OCTAL}\]/g"
My Family[00047]s Vacation
Testing this on macOS, it behaves correctly in both instances. The above behavior is in current CentOS 7.
Since I do need to escape some illegal char values and failing to do so does result in an error code, my solution is to basically try-catch it.
$ ILLEGAL_CHAR="'"
$ OCTAL=00047
$ echo "My Family's Vacation" | { sed "s/${ILLEGAL_CHAR}/\[${OCTAL}\]/g" 2>/dev/null || sed "s/\\${ILLEGAL_CHAR}/\[${OCTAL}\]/g"; }
My Family[00047]s Vacation