I'm using a very minimal busybox system, in which there is no support for ranges in tr
or POSIX character classes, so I have to do it the crappy old-fashioned way. Here's the solution with sed
, stripping ALL non-printable non-ASCII characters from the file:
sed -i 's/[^a-zA-Z 0-9`~!@#$%^&*()_+\[\]\\{}|;'\'':",.\/<>?]//g' FILE