From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from harvard.harvard.edu ([128.103.1.1]) by archone.tamu.edu with SMTP id <45322>; Fri, 17 Apr 1992 16:06:53 -0500 Received: by harvard.harvard.edu (5.54/a0.25) (for rc@archone.tamu.edu) id AA25458; Fri, 17 Apr 92 16:06:40 EST Received: from gatech.UUCP (uucp.gatech.edu) by gatech.edu (4.1/Gatech-9.1) id AA04811 for archone.tamu.edu!rc; Fri, 17 Apr 92 16:54:58 EDT Received: from skeeve.UUCP by gatech.UUCP (4.1/SMI-4.1) id AA03328; Fri, 17 Apr 92 16:02:41 EDT Received: by skeeve.ATL.GA.US (smail2.5) id AA11278; 17 Apr 92 13:18:21 EST (Fri) To: rc@archone.tamu.edu Subject: trailing newlines Message-Id: <9204171318.AA11278@skeeve.ATL.GA.US> Date: Fri, 17 Apr 1992 13:18:21 -0500 From: gatech!skeeve!arnold@harvard.harvard.edu (Arnold D. Robbins) OK, here's another try, (tested, even!): x = ' string with lots of embedded newlines ' gawk ' { if (! first) print save else first = 1 save = $0 } END { printf ("%s", save) }' <<< $x Your luck with other awks may vary, particularly when processing binary data; I have much higher confidence in gawk in that regard. Arnold