I am using this shell script to append text in a new line at the end of file, but it automatically adds a blank line at the end of the file. How to get rid of it?
echo -e "\n$STRING" >> "filename.txt"
Thanks
echo -ne "\n$STRING" >> "filename.txt"
The -n means "don't add a newline".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With