Reputation: 1129
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
Upvotes: 3
Views: 4215
Reputation: 8637
echo -ne "\n$STRING" >> "filename.txt"
The -n means "don't add a newline".
Upvotes: 6