$ gcc -c no_eof.c no_eof.c:9:2: warning: no newline at end of file
The following snippet will fix that for one or more files: perl -i -pl -eof file1 file2 ...
The following is an alternative approach: perl -i -pe '$_ .= $/ if eof and not /\n/' file1 file2 ...
In reply to Add a newline to the end of a file by jmcnamara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |