Path: utzoo!attcan!uunet!mcsun!hp4nl!phigate!ehviea!leo From: leo@ehviea.ine.philips.nl (Leo de Wit) Newsgroups: comp.unix.questions Subject: Re: Deleting (Only) First Blank Line in File Message-ID: <820@ehviea.ine.philips.nl> Date: 2 Jul 90 05:33:40 GMT References: <1651@fallst.UUCP> <819@ehviea.ine.philips.nl> <1607@quando.quantum.de> Reply-To: leo@ehviea.UUCP (Leo de Wit) Distribution: comp Organization: Philips I&E Eindhoven Lines: 30 In article <1607@quando.quantum.de> omerzu@quando.quantum.de (Thomas Omerzu) writes: | |In article <819@ehviea.ine.philips.nl> leo@ehviea.UUCP (Leo de Wit) writes: | |>In article <1651@fallst.UUCP> tkevans@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.