If I have a variable with multiple lines (text) in it, how can I get the last line out of it?
I already figured out how to get the first line:
STRING="This is a
multiple line
variable test"
FIRST_LINE=(${STRING[@]})
echo "$FIRST_LINE"
# output:
"This is a"
Probably there should be an operator for the last line. Or at least I assume that because with @
the first line comes out.