agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Greg Sabino Mullane <greg@turnstep.com>
To: pgsql-sql@postgresql.org
Subject: Re: How would I get rid of trailing blank line?
Date: Mon, 6 Apr 2009 02:21:59 -0000
Message-ID: <f2bd06ed8591a98155db624596667332@biglumber.com> (raw)
In-Reply-To: <FE44E0D7EAD2ED4BB2165071DB8E328C04E84A65@egcrc-ex01.egcrc.org>
-----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-----
view thread (9+ messages) latest in thread
Message-ID: <f2bd06ed8591a98155db624596667332@biglumber.com>
Permalink: ../f2bd06ed8591a98155db624596667332@biglumber.com/
Also on: postgresql.org/message-id/f2bd06ed8591a98155db624596667332@biglumber.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: greg@turnstep.com
Subject: Re: How would I get rid of trailing blank line?
In-Reply-To: <f2bd06ed8591a98155db624596667332@biglumber.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox