Re: tai64nlocal problem

2001-06-16 Thread Frank Tegtmeyer

Lou Hevly <[EMAIL PROTECTED]> writes:

> This seems weird to me, since all the other daemontools don't need to
> be 'initialized' by hitting a return before giving them input.

You confuse STDIN with command line parameters. These are basic
concepts in Unix and even in MS-DOS from the earliest versions.

> while () {
>  my $human_readable = qx!/usr/local/bin/tai64nlocal $_!
> }
> Any suggestions as to how this could be done?

Avoid the external program generally and incorporate the (simple)
conversion into your Perl program.
I you really wan the external program do something like that:

open (DATA, "-| tai64nlocal < $datafile") or die ("...");
while () {
  my $human_readable = $_;
  ...

Frank



Re: tai64nlocal problem

2001-06-15 Thread Lou Hevly

At 17:46 15/06/01, Greg White wrote:
>On Fri, Jun 15, 2001 at 06:29:10PM +0200, Lou Hevly wrote:
>
> > The docs say that tai64nlocal reads lines from stdin.  But for me
> > it just hangs until I hit Ctrl+C:
> >
> > [root:/usr/local/src/daemontools-0.70]$ ./tai64nlocal
> > @400037c219bf2ef02e94
> > ^C
> > [root:/usr/local/src/daemontools-0.70]$
> >
>
>tai64nlocal _does_ read from STDIN.
> From my machine here:
>gregw@frodo:~$ tai64nlocal
>@40003b225d8422c3027c
>2001-06-09 10:31:38.583205500

Thanks for your input.

My problem was that I didn't hit return after typing 'tai64nlocal'.  I
typed:

"tai64nlocal @40003b225d8422c3027c RET"
whereas I should have typed:
"tai64nlocal RET @40003b225d8422c3027c RET"
  ^^^

This seems weird to me, since all the other daemontools don't need to
be 'initialized' by hitting a return before giving them input.

When walking through a log file I'd like to do something like:

while () {
 my $human_readable = qx!/usr/local/bin/tai64nlocal $_!
}

Any suggestions as to how this could be done?

-- 
All the best (Adéu-siau),
Lou Hevly
[EMAIL PROTECTED]
http://www.visca.com




Re: tai64nlocal problem

2001-06-15 Thread Charles Cazabon

Lou Hevly <[EMAIL PROTECTED]> wrote:
> 
> The docs say that tai64nlocal reads lines from stdin.  But for me
> it just hangs until I hit Ctrl+C:

This is normal, expected behaviour.  tai64nlocal reads stdin and writes to
stdout.  tai64nlocal doesn't exit until stdin is closed or the process is
killed.  You're killing it with ^C; if you type ^D instead, you close the
process's stdin and it exits cleanly.

This isn't a qmail issue; it's a shell issue.   If you have further problems,
please take it to a list supporting your OS or whichever shell you use.

Charles
-- 
---
Charles Cazabon<[EMAIL PROTECTED]>
GPL'ed software available at:  http://www.qcc.sk.ca/~charlesc/software/
Any opinions expressed are just that -- my opinions.
---



Re: tai64nlocal problem

2001-06-15 Thread Greg White

On Fri, Jun 15, 2001 at 06:29:10PM +0200, Lou Hevly wrote:
> I would like to begin using multilog instead of splogger. I've
> installed daemontools and run the tests for tai64nlocal successfully:
> 
> [root:/usr/local/src/daemontools-0.70]$ date | ./tai64n | ./tai64nlocal
> 2001-06-15 16:11:06.389339500 Fri Jun 15 16:11:06 GMT 2001
> 
> The docs say that tai64nlocal reads lines from stdin.  But for me
> it just hangs until I hit Ctrl+C:
> 
> [root:/usr/local/src/daemontools-0.70]$ ./tai64nlocal 
> @400037c219bf2ef02e94
> ^C
> [root:/usr/local/src/daemontools-0.70]$
> 

tai64nlocal _does_ read from STDIN. From my machine here:

gregw@frodo:~$ tai64nlocal
@40003b225d8422c3027c
2001-06-09 10:31:38.583205500

The tai timestamp was obtained from a multilog file. The local date was
output by tai64nlocal. Try this timestamp as input (cut 'n' paste):

@40003b225d8422c3027c

Your timestamp above gave me:

gregw@frodo:~$ tai64nlocal
@400037c219bf2ef02e94
1999-08-23 21:04:05.787492500

Did you terminate that timestamp by pressing enter? Or did you just
leave it there...?

-- 
Greg White



tai64nlocal problem

2001-06-15 Thread Lou Hevly

I would like to begin using multilog instead of splogger. I've
installed daemontools and run the tests for tai64nlocal successfully:

[root:/usr/local/src/daemontools-0.70]$ date | ./tai64n | ./tai64nlocal
2001-06-15 16:11:06.389339500 Fri Jun 15 16:11:06 GMT 2001

The docs say that tai64nlocal reads lines from stdin.  But for me
it just hangs until I hit Ctrl+C:

[root:/usr/local/src/daemontools-0.70]$ ./tai64nlocal 
@400037c219bf2ef02e94
^C
[root:/usr/local/src/daemontools-0.70]$

I'm on OpenBSD 2.8.  Thanks.
-- 
All the best (Adéu-siau),
Lou Hevly
[EMAIL PROTECTED]
http://www.visca.com