On Thu, Oct 18, 2012 at 09:48:32PM +0100, David Laight wrote: > On Thu, Oct 18, 2012 at 07:06:55PM +0100, Patrick Welche wrote: > > On Thu, Oct 18, 2012 at 12:57:52PM -0500, David Champion wrote: > > > Does anyone else think this is problematic? I could redo it in C if > > > it's a widespread concern. > > > > As you're offering, I think that would be preferable :-) > > Actually even C programs are a PITA if you are trying to crossbuild. > At the very least, they require special attention. > > Why not pipe through tr -cd in order to remove anything not alphanumeric > or sane punctuation. > Although I suspect that the only problem character is ".
I think piping through: sed -e 's/\\/\\\\/;s/"/\\"/g;s/^/"/;s/$/\\n"/' will put each line inside "" and escape and '\' and '"'. That should be enough to #include into an array initialser. David -- David Laight: da...@l8s.co.uk