Trim last 3 characters of a line WITHOUT using sed, or perl, etc

Viewed 183313

I've got a shell script outputting data like this:

1234567890  *
1234567891  *

I need to remove JUST the last three characters " *". I know I can do it via

(whatever) | sed 's/\(.*\).../\1/'

But I DON'T want to use sed for speed purposes. It will always be the same last 3 characters.

Any quick way of cleaning up the output?

12 Answers
Related