Removing a newline character at the end of a file

A simpler solution than the accepted one:

truncate -s -1 <<file>>

From the truncate man page (man truncate):

-s, --size=SIZE
    set or adjust the file size by SIZE
SIZE may also be prefixed by one of the following modifying characters:
    '+' extend by, '-' reduce by, '<' at most, '>' at least, "https://stackoverflow.com/" round down
    to multiple of, '%' round up to multiple of.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)