Deleting (Only) First Blank Line in File
Leo de Wit
leo at ehviea.ine.philips.nl
Mon Jul 2 15:33:40 AEST 1990
In article <1607 at quando.quantum.de> omerzu at quando.quantum.de (Thomas Omerzu) writes:
|
|In article <819 at ehviea.ine.philips.nl> leo at ehviea.UUCP (Leo de Wit) writes:
|
|>In article <1651 at fallst.UUCP> tkevans at fallst.UUCP (Tim Evans) writes:
|>|Can someone help me to delete the _first_ occurring blank line of a file
|>|(whereever it occurs) without deleting subsequent ones?
|>|
|>|You'd think the following would work, but it doesn't:
|>|
|>| sed 's/^$//1' foo > newfoo
|>
|>Sure. It isn't valid sed syntax.
|
|
|NO! It is valid sed syntax.
|
(this is on Pyramid OSx):
Script started on Mon Jul 2 07:22:27 1990
ehviea_leo> sed 's/^$//1' foo > newfoo
command garbled: s/^$//1
ehviea_leo> exit
ehviea_leo>
script done on Mon Jul 2 07:22:48 1990
So it is at least non-portable.
Leo.
More information about the Comp.unix.questions
mailing list