Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
* Running a PERL script from AX25D
@ 2002-11-01 21:28 pd
  2002-11-15  1:25 ` Craig Small
  0 siblings, 1 reply; 4+ messages in thread
From: pd @ 2002-11-01 21:28 UTC (permalink / raw)
  To: linux-hams

I am trying to run a PERL script as the "server" for some AX25 connections.
My PERL script works fine when I invoke it from the command line.

In ax25d.conf I specifiy a bash script to be run as the session command.
Inside the bash script there is an 'echo' command, which I see when i connect.
Other commands in that script also work.  But then it runs the PERL script and 
everything just stalls.

Here is the bash script:

#!/bin/bash
echo 'wait...'
HOME=/home/bbs
echo 'HOME set'
cd /home/bbs
pwd
perl t.pl

and here is the PERL script:

#!/usr/bin/perl
print "Hi\n";
print "Enter a number\n";
$buf = <STDIN>;
$n = $buf * 2;
print "Twice that is $n\n";
print "bye!\n";

Any suggestions?

KB1EHD


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Running a PERL script from AX25D
  2002-11-15  2:02   ` Kelly Black
@ 2002-11-14 22:48     ` pd
  0 siblings, 0 replies; 4+ messages in thread
From: pd @ 2002-11-14 22:48 UTC (permalink / raw)
  To: Linux Hams mailing list

Except that on AX25 you *want* it to buffer up the output so the packets are 
larger.  Otherwise the protocol becomes inefficient.

I guess I should try an explicit flush just before asking for input.  
Currently I am running it under axspawn, which works, but I am not sure if it 
is buffering up output either.  And it means I have to have a Linux account 
for each user (though they all are in the same directory).

Part of the problem may be that under ax25d STDIN and STDOUT are packet files, 
not byte stream files.  axspawn deals with this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Running a PERL script from AX25D
  2002-11-01 21:28 Running a PERL script from AX25D pd
@ 2002-11-15  1:25 ` Craig Small
  2002-11-15  2:02   ` Kelly Black
  0 siblings, 1 reply; 4+ messages in thread
From: Craig Small @ 2002-11-15  1:25 UTC (permalink / raw)
  To: pd; +Cc: linux-hams

On Fri, Nov 01, 2002 at 09:28:00PM +0000, pd wrote:
> I am trying to run a PERL script as the "server" for some AX25 connections.
> My PERL script works fine when I invoke it from the command line.
> 
> In ax25d.conf I specifiy a bash script to be run as the session command.
> Inside the bash script there is an 'echo' command, which I see when i connect.
> Other commands in that script also work.  But then it runs the PERL script and 
> everything just stalls.

Sounds like a buffering problem to me.  What's that command in perl
again? $| or something.

  - Craig
-- 
Craig Small VK2XLZ  GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/                <csmall@enc.com.au>
MIEEE <csmall@ieee.org>                 Debian developer <csmall@debian.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Running a PERL script from AX25D
  2002-11-15  1:25 ` Craig Small
@ 2002-11-15  2:02   ` Kelly Black
  2002-11-14 22:48     ` pd
  0 siblings, 1 reply; 4+ messages in thread
From: Kelly Black @ 2002-11-15  2:02 UTC (permalink / raw)
  To: Linux Hams mailing list

On Thu, 2002-11-14 at 19:25, Craig Small wrote:
> On Fri, Nov 01, 2002 at 09:28:00PM +0000, pd wrote:
> > I am trying to run a PERL script as the "server" for some AX25 connections.
> > My PERL script works fine when I invoke it from the command line.
> > 
> > In ax25d.conf I specifiy a bash script to be run as the session command.
> > Inside the bash script there is an 'echo' command, which I see when i connect.
> > Other commands in that script also work.  But then it runs the PERL script and 
> > everything just stalls.
> 
> Sounds like a buffering problem to me.  What's that command in perl
> again? $| or something.
> 
>   - Craig

I feel so stupid.  Posting to Majordomo address, Ugh!

Anyway here is what I meant to send to the list, and not to the
subscription bot:

Sounds right.  I have it as:

$| = 1;
(or any non-zero value)
This should unbuffer your script's output.  Without this, your output to
STDOUT is buffered and only sent when a certain block size is reached,
or when the script exits with a less than full buffer.

Kelly Black
KB0GBJ




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-15  2:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-01 21:28 Running a PERL script from AX25D pd
2002-11-15  1:25 ` Craig Small
2002-11-15  2:02   ` Kelly Black
2002-11-14 22:48     ` pd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox