Re: cut off last lines of a document

From: Dag-Erling_Smørgrav <des_at_FreeBSD.org>
Date: Mon, 04 Sep 2023 14:54:14 UTC
"Andreas Kusalananda Kähäri" <kusalananda.kahari@gmail.com> writes:
> Note how this will handle backslash-escaped newlines in the input, and
> that, depending on the shell and its configuration, the "echo" call may
> or may not expand backslash-escaped characters in the input (e.g. "\n"
> and "\t").  The "echo" may also interpret the string "-n" as an option
> it occurs on its own line.  You may also lose flanking whitespace.

Right.  If your shell is broken, use read -r and replace echo with
printf "%s\n".  Or don't use a broken shell.

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org