[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pipe help

on Fri, Oct 26, 2001 at 07:29:36PM -0500, Hall Stevenson (hallstevenson@mindspring.com) wrote:
> I think this should be simple...
> I want to run a command (traceroute) and have the date/time listed
> before the trace output. I'll do this multiple times and want to keep
> appending to the same file.
> The results will ideally look something like this:
> 'date/time'
> (trace results)
> 'date/time'
> (trace results)


    for ip in <list>; do date; traceroute $ip; echo; done | tee <file>

...where <list> is the list of IPs to trace, and <file> is the file
you're logging to.


Karsten M. Self <kmself@ix.netcom.com>       http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?             Home of the brave
  http://gestalt-system.sourceforge.net/                   Land of the free
   Free Dmitry! Boycott Adobe! Repeal the DMCA! http://www.freesklyarov.org
Geek for Hire                     http://kmself.home.netcom.com/resume.html

Attachment: pgpU_bH5OnTeH.pgp
Description: PGP signature

Reply to: