Issue
The box has no Ruby/Python/Perl etc.
Only bash
, sed
, and awk
.
A way is to replace chars by map, but it becomes tedious.
Perhaps some built-in functionality i'm not aware of?
Solution
Escaping HTML really just involves replacing three characters: <
, >
, and &
. For extra points, you can also replace "
and '
. So, it's not a long sed
script:
sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'
Answered By - ruakh Answer Checked By - David Goodson (WPSolving Volunteer)