Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id C85D3632662 for ; Sun, 5 Apr 2009 23:22:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75173-08 for ; Sun, 5 Apr 2009 23:22:15 -0300 (ADT) Received: from mx3.hub.org (mx3.hub.org [206.223.169.73]) by mail.postgresql.org (Postfix) with ESMTP id 8F26F6324C2 for ; Sun, 5 Apr 2009 23:22:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tinlc.com (unknown [72.18.206.65]) by mx3.hub.org (Postfix) with ESMTP id 1FCDA37B50B for ; Sun, 5 Apr 2009 23:22:14 -0300 (ADT) Received: from biglumber.com ([72.18.206.64] helo=localhost) by tinlc.com with smtp (Exim 4.60) (envelope-from ) id 1LqeTH-00044m-LW; Sun, 05 Apr 2009 21:21:59 -0500 From: "Greg Sabino Mullane" To: pgsql-sql@postgresql.org Subject: Re: How would I get rid of trailing blank line? X-PGP-Key: 2529 DF6A B8F7 9407 E944 45B4 BC9B 9067 1496 4AC8 X-Request-PGP: http://www.biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 In-Reply-To: Date: Mon, 6 Apr 2009 02:21:59 -0000 X-Mailer: JoyMail 2.01 Message-ID: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/39 X-Sequence-Number: 32385 -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 > report at the bottom. There is a blank line > at the bottom, however. Is there any way to > have psql not give me that blank line? Now that my presenation on psql is over :), I'll share my solution: psql -AX -qt -c "SELECT ..." | perl -pe 's/^\n// if $.<2' This strips a newline from the first line only of the output, and only if the line consists of nothing else. Highly recommended for cron. - -- Greg Sabino Mullane greg@turnstep.com End Point Corporation PGP Key: 0x14964AC8 200904052221 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iEYEAREDAAYFAknZZ0YACgkQvJuQZxSWSsiDAwCglJS9/juQLe8asY3sG9fagbeo 2V4An0p5U6UHGI1KXoe2qQvURX5E5BZo =Yy0J -----END PGP SIGNATURE-----