Re: Node query

2000-04-10 Thread Tomi Manninen OH2BNS

On Mon, 10 Apr 2000, Robin Gilks wrote:

> > > The line in my node.conf that is affected is:
> > > Alias   CONVers   "telnet %{2:gb7ipd.ampr.org} 3600 \"/n %u %{1:160}\""
> > > 
> > > and its the bit in the quotes at the end that don't work no more...

Actually you'll probably find that the first part won't work either. You
won't be able to specify another convers server at runtime...

> > What does work is;
> > 
> > 'telnet %{2:gb7ipd.ampr.org} 3600 "/n %u %{1:160}\n/w *"'
>
> Changing the double quotes to single quotes and removing the escape character
> from the double quotes fixed it!!
> 
> Not an obvious problem!!

The reason is that those %-escapes get processed twice: first when the
configuration file is read and later when the alias is actually executed.
The problem is that positional parameters (%1 and %2 in this case) don't
really have a meaning when the configuration file is read. They only have
a meaning when the alias is executed. So you need to be able to enter the
alias definition so that the %-escapes are not processed while reading the
config but only at alias execution time. That required a slight change in
the config syntax. The change is documented (see the HISTORY file,
node.conf(5) manual page and the sample files) but probably very easy to
miss...

The way it works is probably easiest explained with the example included
in the sample file:

ExtCmd TIme 1 nobody /bin/echo echo %N Node session started at %I, current time is \%I.

The %N will be expanded to the NodeId (at startup so NodeId needs to be
specified above this). %I will be the current time again at the time the
config file is read. The second %I has the percent sign escaped so it will
be expanded only when the extcmd is executed. (The same effect would have
resulted from enclosing it in single quotes: '%I')

I know this may sound confusing (I certainly was first confused when
trying to code it) but IMHO when you understand it, you'll see that it is
the only clean way of implementing it.

-- 
Tomi Manninen   Internet:  [EMAIL PROTECTED]
OH2BNS  AX.25: [EMAIL PROTECTED]
KP20ME04Amprnet:   [EMAIL PROTECTED]




Re: Node query

2000-04-10 Thread Robin Gilks

Thanks Richard

Changing the double quotes to single quotes and removing the escape character
from the double quotes fixed it!!

Not an obvious problem!!

On Sun, 09 Apr 2000, you wrote:
> On Sun, 09 Apr 2000,  Robin Gilks wrote about,  Node query:
> > Greetings
> > 
> > You can tell I had a lazy weekend - lots of questions!!
> > 
> > This one is about something that worked on in linux-node 0.2.4 but doesn't
> > appear to work on linux-node 0.3.0. Its the expansion of an alias that sends a
> > string after a telnet connect. In the old version it was OK, the new one not
> > unless its a 'feature' of the newer kernel (old box is 2.0.36, 2.1.42 tools;
> > new box is 2.2.13 kernel, 0.0.5 tools) flushing the data.
> > 
> > The line in my node.conf that is affected is:
> > Alias   CONVers   "telnet %{2:gb7ipd.ampr.org} 3600 \"/n %u %{1:160}\""
> > 
> > and its the bit in the quotes at the end that don't work no more...
> 
> What does work is;
> 
> 'telnet %{2:gb7ipd.ampr.org} 3600 "/n %u %{1:160}\n/w *"'
> 

-- 

73 de Robin. G8ECJ  Hub manager gb7ipd

NTS: G8ECJ@GB7TVG.#42.GBR.EUAmprNet:   [EMAIL PROTECTED]
Internet: [EMAIL PROTECTED] http://www.gb7ipd.freeserve.co.uk/
Shack: (+44) 1628 533311Fax:  (+44) 1628 850165
Club pages (g4xyw modem etc) at http://www.tvipug.freeserve.co.uk



Node query

2000-04-09 Thread Robin Gilks

Greetings

You can tell I had a lazy weekend - lots of questions!!

This one is about something that worked on in linux-node 0.2.4 but doesn't
appear to work on linux-node 0.3.0. Its the expansion of an alias that sends a
string after a telnet connect. In the old version it was OK, the new one not
unless its a 'feature' of the newer kernel (old box is 2.0.36, 2.1.42 tools;
new box is 2.2.13 kernel, 0.0.5 tools) flushing the data.

The line in my node.conf that is affected is:
Alias   CONVers   "telnet %{2:gb7ipd.ampr.org} 3600 \"/n %u %{1:160}\""

and its the bit in the quotes at the end that don't work no more...

-- 

73 de Robin. G8ECJ  Hub manager gb7ipd

NTS: G8ECJ@GB7TVG.#42.GBR.EUAmprNet:   [EMAIL PROTECTED]
Internet: [EMAIL PROTECTED] http://www.gb7ipd.freeserve.co.uk/
Shack: (+44) 1628 533311Fax:  (+44) 1628 850165
Club pages (g4xyw modem etc) at http://www.tvipug.freeserve.co.uk