dexen deVries
2012-01-26 12:15:09 UTC
hi list,
can't wrap my head around this: in an awk script, how to take some action if a
file lacks last trailing Line Feed?
i want to modify files with contents like:
text LF
text LF
text
and leave undisturbed files with content like:
text LF
text LF
text LF
in other words, i want to either:
- match line that is empty and is last line of file (awk doesn't seem to take
any action on such line), or, alternatively,
- match a line that is last line of file and lacks terminating LF.
can't wrap my head around this: in an awk script, how to take some action if a
file lacks last trailing Line Feed?
i want to modify files with contents like:
text LF
text LF
text
and leave undisturbed files with content like:
text LF
text LF
text LF
in other words, i want to either:
- match line that is empty and is last line of file (awk doesn't seem to take
any action on such line), or, alternatively,
- match a line that is last line of file and lacks terminating LF.
--
dexen deVries
[[[↓][→]]]
Already many of the mutants disguised as human beings are walking the streets
of Earth's cities.
-- Music Instructor, ``Electro City''
dexen deVries
[[[↓][→]]]
Already many of the mutants disguised as human beings are walking the streets
of Earth's cities.
-- Music Instructor, ``Electro City''