Submission + - Shell 'string escape' tool?
orangesquid writes: "[NOTE! TO! EDITOR!!!! — in dillo, there's no dropdown box to select story category, such as "Ask Slashdot", etc. Since I've already typed this up, I just ask that you assign the category correctly; for future reference for the slashcode workers, it might be a good idea to test against dillo, as it adheres to HTML standards and does not utilize scripting, so it effectively encompasses how Lynx, Wget's link-evaluating engine, and many other tools probably see the slashcode-HTML.]
I wanted to ask: is there a shell tool (besides the sed/awk/bash/perl scripts I've cooked up on the fly) that is dedicated to *escaping*? In the Unix tradition of "one small tool that does its job well," I would expect there to be a tool floating around that was very, very good at escaping strings for nearly any purpose (escaping for HTML3, XML; grep/sed regex, extended grep regex, perl regex; bash glob strings w/ and w/o extglob, etc), dedicated to doing that and *only* that. However, after googling, looking through GNU's site, checking previous Ask Slashdot-s, and scouting freshmeat, I haven't found any dedicated tools. I have found plenty of small scripts for dedicated purposes, but I have found no tools for general string escaping. What I envision is something that can take strings line-by-line, word-by-word, or NUL-byte--by--NUL-byte, and escape a number of string components of various forms (HTML or XML entities, ANSI [or other terminal] escape sequences, regex special characters, etc). Does such a tool exist? If not, I would definitely write one, but I don't want to duplicate someone else's work to no useful end!"
I wanted to ask: is there a shell tool (besides the sed/awk/bash/perl scripts I've cooked up on the fly) that is dedicated to *escaping*? In the Unix tradition of "one small tool that does its job well," I would expect there to be a tool floating around that was very, very good at escaping strings for nearly any purpose (escaping for HTML3, XML; grep/sed regex, extended grep regex, perl regex; bash glob strings w/ and w/o extglob, etc), dedicated to doing that and *only* that. However, after googling, looking through GNU's site, checking previous Ask Slashdot-s, and scouting freshmeat, I haven't found any dedicated tools. I have found plenty of small scripts for dedicated purposes, but I have found no tools for general string escaping. What I envision is something that can take strings line-by-line, word-by-word, or NUL-byte--by--NUL-byte, and escape a number of string components of various forms (HTML or XML entities, ANSI [or other terminal] escape sequences, regex special characters, etc). Does such a tool exist? If not, I would definitely write one, but I don't want to duplicate someone else's work to no useful end!"