Re: How to pipe the psql copy command to Unix 'Date' command

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to pipe the psql copy command to Unix 'Date' command
Date: 2009-03-03 00:12:05
Message-ID: 200903021612.05199@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 02 March 2009, John R Pierce <pierce(at)hogranch(dot)com> wrote:
> SHARMILA JOTHIRAJAH wrote:
> > Is it possible to sent this 'time' output to a file...
> > If I try
> > time cmd1 someargs1 | cmd2 someargs2 > output.log
> >
> > it doesn't sent the "time" to the file...
>
> time (cmd1 someargs1 | cmd2 someargs2) > output.log
>
>
> the way you had it, it was only timing cmd1. with the ( ), its spawning
> a subshell which should run both commands piped...

time also reports on stderr, not stdout.

time (cmd1 someargs1 | cmd2 someargs2) > output.log 2>&1

--
Even a sixth-grader can figure out that you can’t borrow money to pay off
your debt

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Angelo Astorga 2009-03-03 00:14:05 Log en Postgresql 8.1.11
Previous Message Greg Smith 2009-03-03 00:05:00 Re: Detemine database size on Postgres 8.0