Getting rid of non-numeric and non-characters

I have a database script that always produces the following output:

0

btw, the unwanted character looks like a square on a unix system. it doesn't look like the above quote.

how can I get rid of it and only keep the "0"?

---------- Post updated at 01:57 PM ---------- Previous update was at 01:54 PM ----------

output:

0

The character in the post is Octal 001 (crtrl/A).

We can remove to with "tr". Note on my test it was the real ctrl/A not the two characters ^A .

echo "0^A"|tr -d "\001"
0

The more general case of deleting any non-numeric character (excluding newline) can also be done with "tr".

echo "0^A"|tr -cd '0-9\n'
0

Well, tr is fine for all 255 byte values, but nulls are a problem. Sometimes I pipe the text through cat -vt so I have no funny characters to deal with.