$ 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 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Add a newline to the end of a file
by PodMaster (Abbot) on Nov 28, 2002 at 13:08 UTC | |
by jmcnamara (Monsignor) on Nov 28, 2002 at 13:46 UTC | |
by simonflk (Pilgrim) on Nov 28, 2002 at 13:39 UTC |