Here’s an old-fashioned unix trick for removing the last 3 characters from a line that
makes no use of sed OR awk…
> echo 987654321 | rev | cut -c 4- | rev
987654
Unlike the earlier example using ‘cut’, this does not require knowledge of the line length.