I want to append a colon character (:) at the end of the last line of a text file (not in a new line).
- My file already has a \n character at the end so
printf ":" >> file
puts the colon in a new line. - Using
sed '$s/$/:/' file > newfile
works, but my file is ~100 MB so piping the whole thing just to add a single character seems unattractive.
Is there a better solution?