I need help with insert text to the last line of text file with echo command
I know can do something like
echo "i4\n$logtext\n.\nwq" | ex -s $file
can insert to first line, but how can i change this code in order to insert to the last line of text file?
please help, thank you