home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 15 Message
/
15-Message.zip
/
oe991016.zip
/
Rx991015.txt
< prev
next >
Wrap
Text File
|
1999-10-16
|
58KB
|
1,730 lines
Programming/using OS/2 REXX (echo)
Saturday, 09-Oct-1999 to Friday, 15-Oct-1999
+----------------------------------------------------------------------------+
From: David Noon 07-Oct-99 17:41:00
To: Eddy Thilleman 09-Oct-99 10:45:09
Subj: hstart wget?
In a message dated 10-01-99, Eddy Thilleman said to Mike Ruskai about
"hstart wget?"
Hi Eddy,
MR> It's 'READY:', not 'READY'. Though in PC-DOS 7's REXX, it is 'READY'.
MR> So, you might want to do this:
MR> if left(check,5) != 'READY' then do
ET>In my latest version, I do
ET> if pos( 'READY', check ) = 1 then /* if we opened file */
The definitive test is really an exact byte comparison on the string:
IF check == 'READY:' THEN
Note the double equal sign.
ET>the same condition with the do while
ET>> do while stream( InFile, 'state' ) = 'READY'
MR> lines() or chars() would be better here.
ET>why?
I don't see any reason. In fact, checking the STATE would be marginally less
overhead. Again, I would recommend an exact byte comparison:
DO WHILE STREAM(InFile,'STATE') == 'READY'
Regards
Dave
<Team PL/I>
___
* MR/2 2.25 #353 * "More tea, vicar?"
--- Maximus/2 3.01
* Origin: Air Applewood, OS/2 Gateway to Essex 44-1279-792300 (2:257/609)
45
+----------------------------------------------------------------------------+
From: Ron Mitchell 09-Oct-99 05:24:00
To: John Clarke 09-Oct-99 10:45:09
Subj: hstart wget?
John Clarke wrote in a message to Jonathan de Boyne Pollard:
JdBP> If it helps, the TEE in OS2CLU02.ZIP doesn't require any non-system
JdBP> DLLs other than the one that is supplied along with it in the very
JdBP> same archive.
JC> I would appreciate it if you would email a copy of this file to me
JC> at the email address below or point me towards a place where I can
JC> grab it from the 'net.
You can pick it up at http://www.riverbbs.net in the files section. Also at
telnet://riverbbs.net.
L8r,
Ron
... Keep your OS/2 system healthy by practicing safe REXX.
---
* Origin: River Canyon Rd. BBS Chattanooga,TN 423-886-2521 (1:362/627)
+----------------------------------------------------------------------------+
From: Rich Wonneberger 09-Oct-99 10:18:00
To: David Noon 10-Oct-99 01:50:04
Subj: hstart wget?
*** Quoting David Noon to Eddy Thilleman dated 10-07-99 ***
> IF check == 'READY:' THEN
>
> Note the double equal sign.
David,
I've seen the double equal sign in DOS batch program. What does this do thats
different then single equal?
TIA
Rich
I-Net turtil@frontiernet.net
... Madness takes its toll.
---
* Origin: Turtil's Pond BBS. Monroe NY. 914-783-2106 (1:2625/50)
+----------------------------------------------------------------------------+
From: Eddy Thilleman 06-Oct-99 22:03:07
To: John Clarke 10-Oct-99 01:50:04
Subj: hstart wget?
Hello John,
02 Oct 99 19:31, John Clarke wrote to Eddy Thilleman:
ET>> I asked this in the wget mailing list, it is possible if you use
ET>> a program 'tee' in addition:
JC> I'd appreciate a copy of 'tee' attached to my email address below if
JC> you can organise it.
I've a tee but it needs a GNU lib file which I don't have.
Greetings -=Eddy=- email: eddy.thilleman@net.hcc.nl
... NT? New Technology? I don't think so...
--- GoldED/2 3.0.1
* Origin: Windows98 is a graphic DOS extender (2:500/143.7)
+----------------------------------------------------------------------------+
From: Eddy Thilleman 06-Oct-99 22:04:24
To: Jonathan De Boyne Pollard 10-Oct-99 01:50:04
Subj: hstart wget?
Hello Jonathan,
02 Oct 99 12:46, Jonathan de Boyne Pollard wrote to Eddy Thilleman:
ET>> (or use a tee version which doesn't need the gnushu lib files).
JP> If it helps, the TEE in OS2CLU02.ZIP doesn't require any non-system
JP> DLLs other than the one that is supplied along with it in the very
JP> same archive.
I haven't looked, but I'll in the weekend.
Greetings -=Eddy=- email: eddy.thilleman@net.hcc.nl
... I have shifting antigens. Don't even try to find a cure.
--- GoldED/2 3.0.1
* Origin: Windows95 is a graphic DOS extender (2:500/143.7)
+----------------------------------------------------------------------------+
From: Eddy Thilleman 06-Oct-99 22:50:15
To: Jack Stein 10-Oct-99 01:50:04
Subj: hstart wget?
Hello Jack,
03 Oct 99 23:42, Jack Stein wrote to Eddy Thilleman:
JS> Something like that might work.
I don't know yet, I've too much work now. Later I could look at this (maybe).
Greetings -=Eddy=- email: eddy.thilleman@net.hcc.nl
... Windows Now Terminated
--- GoldED/2 3.0.1
* Origin: Windows95 is a graphic DOS extender (2:500/143.7)
+----------------------------------------------------------------------------+
From: Eddy Thilleman 09-Oct-99 09:31:00
To: Mike Ruskai 10-Oct-99 01:50:04
Subj: hstart wget?
Hello Mike,
03 Oct 99 17:23, MIKE RUSKAI wrote to EDDY THILLEMAN:
MR> the read/write pointer is at the end. The lines() function returns 1
MR> if there's at least one line-end in the file (with the lines() method
MR> of the stream class in OREXX, it actually counts the lines in the
MR> file). The chars() function returns the character count remaining
MR> ahead of the read/write pointer.
Thanks for the explanation.
OK, I choose Lines() because I read whole lines at a time.
Greetings -=Eddy=- email: eddy.thilleman@net.hcc.nl
... Lucky people gets OS/2, unfortunate people gets NT...
--- GoldED/2 3.0.1
* Origin: Windows98 is a graphic DOS extender (2:500/143.7)
+----------------------------------------------------------------------------+
From: Ron Mitchell 09-Oct-99 20:25:24
To: Rich Wonneberger 10-Oct-99 01:50:04
Subj: hstart wget?
Rich Wonneberger wrote in a message to David Noon:
RW> *** Quoting David Noon to Eddy Thilleman dated 10-07-99 ***
> IF check == 'READY:' THEN
>
> Note the double equal sign.
RW> I've seen the double equal sign in DOS batch program. What does
RW> this do thats different then single equal?
== is a strict character by character string comparison.
=
Anything that can resolve to a numeric value is resolved and then compared
mathematically. Leading and trailing blanks are stripped. Case sensitive.
==
Strictly a string comparison. Blanks are not stripped. Case sensitive.
== is faster than = because of the lack of preprocessing. It is also safer if
all you are interested in is a character by character comparison.
L8r,
Ron
... f y cn rd ths, y cn gt gd jbs n cmptr prgrmng.
---
* Origin: River Canyon Rd. BBS Chattanooga,TN 423-886-2521 (1:362/627)
+----------------------------------------------------------------------------+
From: John Clarke 08-Oct-99 20:52:19
To: Gord Hannah 10-Oct-99 19:23:11
Subj: hstart wget?
On Oct 05, 1999 at 06:21 hrs, Gord Hannah of 1:17/23.1 wrote to John Clarke:
Hello Gord,
GH> Replying to a message from John Clarke 3:713/730 to Eddy Thilleman,
GH> About hstart wget?, On Sat Oct 02 1999
ET>> program 'tee' in addition:
JC>> I'd appreciate a copy of 'tee' attached to my email address below if
JC>> you can organise it.
GH> Pickup a copy of OS2CLU02.ZIP at hobbes, these utilities are
GH> fantastic, mind you I am biased I am on the test team.
Thanks. I will do so tonight.
Regards ... John
Email: jclarke@zip.com.au
--- MsgedSQ/2 3.30
* Origin: The Clearing House (3:713/730)
45
+----------------------------------------------------------------------------+
From: Rich Wonneberger 10-Oct-99 15:18:00
To: Ron Mitchell 10-Oct-99 19:23:11
Subj: hstart wget?
*** Quoting Ron Mitchell to Rich Wonneberger dated 10-09-99 ***
> == is a strict character by character string comparison.
>
> =
>
> Anything that can resolve to a numeric value is resolved and then
> compared mathematically. Leading and trailing blanks are stripped.
> Case sensitive.
>
> ==
>
> Strictly a string comparison. Blanks are not stripped. Case
> sensitive.
Ron,
Thanks for the lesson.
Is there any way to get a non case sensitive comparison??
Rich
I-Net turtil@frontiernet.net
... Editing is a rewording activity.
---
* Origin: Turtil's Pond BBS. Monroe NY. 914-783-2106 (1:2625/50)
+----------------------------------------------------------------------------+
From: David Noon 09-Oct-99 00:39:00
To: Mike Ruskai 11-Oct-99 23:10:20
Subj: hstart wget?
In a message dated 10-03-99, Mike Ruskai said to Eddy Thilleman about
"hstart wget?"
Hi Mike,
ET>> do while stream( InFile, 'state' ) = 'READY'
MR> lines() or chars() would be better here.
ET> why?
MR>Because I don't see why a stream would fail to be ready simply because
MR>the read/write pointer is at the end.
Well, it returns 'NOTREADY' when it hits end-of-file for the first time, and
'ERROR' for subsequent reads. [Assuming it was opened for read access.]
Regards
Dave
<Team PL/I>
___
* MR/2 2.25 #353 * Windows Error: 003 - Windows found. System halted.
--- Maximus/2 3.01
* Origin: Air Applewood, OS/2 Gateway to Essex 44-1279-792300 (2:257/609)
45
+----------------------------------------------------------------------------+
From: David Noon 09-Oct-99 00:41:01
To: John Clarke 11-Oct-99 23:10:20
Subj: TEE command
In a message dated 10-02-99, John Clarke said to Eddy Thilleman about
"hstart wget?"
Hi John,
ET> I asked this in the wget mailing list, it is possible if you use a
ET> program 'tee' in addition:
JC>I'd appreciate a copy of 'tee' attached to my email address
JC>below if you can organise it.
Since this is the OS2REXX echo, we can write our own!
================================= TEE.CMD ==================================
/* REXX version of the TEE command */
PARSE ARG Arg_list
Append_flag = TRANSLATE(WORD(Arg_list,1))
/* Remove the /A flag if supplied */
IF Append_flag == '/A' THEN
DO
Arg_list = STRIP(SUBSTR(Arg_list,3),'L')
Append_flag = 'APPEND'
END
ELSE
Append_flag = 'REPLACE'
/* Make sure at least 1 file was specified */
IF LENGTH(Arg_list) = 0 THEN EXIT 12
File_name = .ARRAY~NEW(1)
/* Parse the filenames into an array of strings */
p = VERIFY(Arg_list,' ')
DO i = 1 BY 1 WHILE p += 0
IF SUBSTR(Arg_list,p,1) == "'" | SUBSTR(Arg_list,p,1) == '"' THEN
DO
q = VERIFY(Arg_list,SUBSTR(Arg_list,p,1),'M',p+1)
p = p + 1
DO WHILE SUBSTR(Arg_list,q,1) == SUBSTR(Arg_list,q+1,1)
q = VERIFY(Arg_list,SUBSTR(Arg_list,p,1),'M',q+2)
END
END
ELSE
q = VERIFY(Arg_list,' ','M',p+1)
IF q = 0 THEN q = LENGTH(Arg_list) + 1
File_name[i] = SUBSTR(Arg_list,p,q-p+1)
p = VERIFY(Arg_list,' ','N',q+1)
END
/* Open a corresponding array of stream objects */
File_stream = .ARRAY~NEW(File_name~ITEMS())
DO i = 1 TO File_name~ITEMS()
File_stream[i] = .STREAM~NEW(File_name[i])~~OPEN('WRITE '||Append_flag)
END
DROP File_name
/* Open standard devices */
Stdin = .STREAM~NEW('STDIN:')~~OPEN('READ')
Stdout = .STREAM~NEW('STDOUT:')~~OPEN('WRITE')
/* Copy the lines across */
DO WHILE Stdin~STATE() == 'READY'
Line_buff = Stdin~LINEIN()
DO Output_file OVER File_stream
Output_file~LINEOUT(Line_buff)
END
Stdout~LINEOUT(Line_buff)
END
DROP Output_file
/* Close all the files */
DO i = File_stream~FIRST() TO File_stream~LAST()
File_stream[i]~CLOSE()
END
Stdin~CLOSE()
Stdout~CLOSE()
EXIT 0
============================================================================
As is my usual practice in this echo, I typed this code directly into my QWK
reader, so it is totally untested. Note that it is in Object REXX.
Regards
Dave
<Team PL/I>
___
* MR/2 2.25 #353 * Microsoft Windows: Proof that P.T. Barnum was correct.
--- Maximus/2 3.01
* Origin: Air Applewood, OS/2 Gateway to Essex 44-1279-792300 (2:257/609)
45
+----------------------------------------------------------------------------+
From: David Noon 09-Oct-99 20:29:00
To: John Clarke 11-Oct-99 23:10:20
Subj: TEE command
In a message dated 10-09-99, David Noon said to John Clarke about "TEE
command"
Hi John,
DN>Since this is the OS2REXX echo, we can write our own!
We can also improve it by removing the argument parsing and placing that
into a new class library. This allows us to reuse that code wherever we want
to convert an argument string into an array of values, in the manner typical
of C/C++ start-up code.
================================= TEE.CMD ==================================
/* REXX version of the TEE command */
/* Build array of program arguments. Use the typical C/C++ name. */
argv = .ARGARRAY~NEW(ARG(1))
/* Remove the /A flag if supplied */
IF argv[1]~TRANSLATE() == '/A' THEN
DO
argv~REMOVE(1)
Append_flag = 'APPEND'
END
ELSE
Append_flag = 'REPLACE'
/* Make sure at least 1 file was specified */
IF argv~ITEMS() = 0 THEN EXIT 12
/* Open a corresponding array of stream objects */
File_stream = .ARRAY~NEW(argv~ITEMS())
i = 1
DO File_name OVER argv
File_stream[j] = .STREAM~NEW(File_name)~~OPEN('WRITE '||Append_flag)
i = i + 1
END
/* Finished with these */
DROP argv Append_flag File_name
/* Open standard devices */
Stdin = .STREAM~NEW('STDIN:')~~OPEN('READ')
Stdout = .STREAM~NEW('STDOUT:')~~OPEN('WRITE')
/* Copy the lines across */
DO WHILE Stdin~STATE() == 'READY'
Line_buff = Stdin~LINEIN()
DO Output_file OVER File_stream
Output_file~LINEOUT(Line_buff)
END
Stdout~LINEOUT(Line_buff)
END
DROP Output_file
/* Close all the files */
DO i = File_stream~FIRST() TO File_stream~LAST()
File_stream[i]~CLOSE()
END
Stdin~CLOSE()
Stdout~CLOSE()
EXIT 0
::REQUIRES 'ARGARRAY.CMD'
============================================================================
And here is the class for forming arrays of arguments. It is actually a
useful piece of code. You should put it in a PATH directory.
============================== ARGARRAY.CMD ================================
/* REXX class library to build argument arrays from character strings */
/* such as command tails. */
/* Author: David W. Noon, October 1999 */
/* You may use this code freely, and redistribute it provided the */
/* original copyright caveat is retained and no charge is levied */
/* beyond the price of its distribution medium. */
/* No warranty is expressed or implied as to the suitability of this */
/* software to perform any given task, nor will the author accept */
/* liability for any damage or loss incurred by its use. */
/* Copyright (C) 1999, David W. Noon. All rights reserved. */
::CLASS ARGARRAY PUBLIC
::METHOD INIT
EXPOSE Arg_array
/* Only allow a single argument */
IF ARG() < 1 THEN RAISE SYNTAX 93.901 ADDITIONAL 1
IF ARG() > 1 THEN RAISE SYNTAX 93.902 ADDITIONAL 1
/* Extract argument string */
Arg_string = ARG(1)~STRIP()
/* Ensure it isn't a null string */
IF Arg_string~LENGTH() = 0 THEN RAISE SYNTAX 93.911 ADDITIONAL 1
/* Build an array. */
Arg_array = .ARRAY~NEW(1)
/* Now parse out the arguments into array elements */
DO i = 1 BY 1 UNTIL Arg_string~LENGTH() = 0
SELECT
WHEN Arg_string~LEFT(1) == "'" THEN
DO
r = Arg_string~VERIFY("'",'M',2)
DO WHILE r > 0 & Arg_string~SUBSTR(r+1,1) == "'"
r = Arg_string~VERIFY("'",'M',r+2)
END
/* See if we have an unmatched apostrophe */
IF r = 0 THEN RAISE SYNTAX 6.2
/* Ensure next character is comma or space */
IF r < Arg_string~LENGTH() THEN
IF VERIFY(' ,',Arg_string~SUBSTR(r+1,1),'M') = 0 THEN
RAISE SYNTAX 22.1 ADDITIONAL(Arg_string~LEFT(r+1))
Arg_array~PUT(SQUOTE(Arg_string~SUBSTR(2,r-2),"'"),i)
END
WHEN Arg_string~LEFT(1) == '"' THEN
DO
r = Arg_string~VERIFY('"','M',2)
DO WHILE r > 0 & Arg_string~SUBSTR(r+1,1) == '"'
r = Arg_string~VERIFY('"','M',r+2)
END
/* See if we have an unmatched quote */
IF r = 0 THEN RAISE SYNTAX 6.3
/* Ensure next character is comma or space */
IF r < Arg_string~LENGTH() THEN
IF VERIFY(' ,',Arg_string~SUBSTR(r+1,1),'M') = 0 THEN
RAISE SYNTAX 22.1 ADDITIONAL(Arg_string~LEFT(r+1))
Arg_array~PUT(SQUOTE(Arg_string~SUBSTR(2,r-2),'"'),i)
END
WHEN Arg_string~LEFT(1) == ',' THEN
DO
r = 1
Arg_array~PUT('',i)
END
OTHERWISE
DO
r = Arg_string~VERIFY(" ,",'M')
IF r = 0 THEN r = Arg_string~LENGTH() + 1
Arg_array~PUT(Arg_string~SUBSTR(1,r-1),i)
END
END
Arg_string = Arg_string~DELSTR(1,r)~STRIP('L')
END
RETURN
/* Fake inheritance */
::METHOD UNKNOWN
EXPOSE Arg_array
USE ARG Method_name, Parm_array
FORWARD MESSAGE(Method_name) TO(Arg_array) ARGUMENTS(Parm_array) CONTINUE
RETURN RESULT
/* Internal subroutine to condense doubled quote marks */
::ROUTINE SQUOTE
Str = ARG(1)
Qt = ARG(2)
p = VERIFY(Str,Qt,'M')
DO WHILE p > 0
IF Str~SUBSTR(p+1,1) == Qt THEN Str = Str~DELSTR(p+1,1)
p = VERIFY(Str,Qt,'M',p+1)
END
RETURN Str
============================================================================
And this still applies to TEE.CMD ...
DN>As is my usual practice in this echo, I typed this code directly into my
DN>QWK reader, so it is totally untested. Note that it is in Object REXX.
Regards
Dave
<Team PL/I>
___
* MR/2 2.25 #353 * Buy the dog, get the fleas free of charge.
--- Maximus/2 3.01
* Origin: Air Applewood, OS/2 Gateway to Essex 44-1279-792300 (2:257/609)
45
+----------------------------------------------------------------------------+
From: MIKE RUSKAI 11-Oct-99 04:58:00
To: DAVID NOON 11-Oct-99 23:10:20
Subj: hstart wget?
Some senseless babbling from David Noon to Mike Ruskai
on 10-09-99 00:39 about hstart wget?...
DN> In a message dated 10-03-99, Mike Ruskai said to Eddy Thilleman about
DN> "hstart wget?"
DN> Hi Mike,
ET>> do while stream( InFile, 'state' ) = 'READY'
MR> lines() or chars() would be better here.
ET> why?
MR>Because I don't see why a stream would fail to be ready simply because
MR>the read/write pointer is at the end.
DN> Well, it returns 'NOTREADY' when it hits end-of-file for the first
DN> time, and 'ERROR' for subsequent reads. [Assuming it was opened for
DN> read access.]
I guess that'd work. But if it's opened for read/write access, it
certainly wouldn't. That's probably why I got in the habit of using
lines() or chars() early on.
Mike Ruskai
thannymeister@yahoo.com
... And then Lancelot, Sir Robin and I will jump out of the rabbit... uhhh
___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
* Origin: FIDO QWK MAIL & MORE! WWW.DOCSPLACE.ORG (1:3603/140)
45
+----------------------------------------------------------------------------+
From: Eddy Thilleman 10-Oct-99 16:06:10
To: David Noon 11-Oct-99 23:10:20
Subj: hstart wget?
Hello David,
07 Oct 99 17:41, David Noon wrote to Eddy Thilleman:
DN> The definitive test is really an exact byte comparison on the string:
DN> IF check == 'READY:' THEN
DN> Note the double equal sign.
I had tried that first, but once the ':' was present and another try the ':'
was not present (with the same syntax?), so I was confused and didn't try
more.
DN> I don't see any reason. In fact, checking the STATE would be
DN> marginally less overhead. Again, I would recommend an exact byte
DN> comparison:
DN> DO WHILE STREAM(InFile,'STATE') == 'READY'
But when "READY:" is returned this returnes false? But I don't have time to
investigate this now.
Greetings -=Eddy=- email: eddy.thilleman@net.hcc.nl
... "All constants are variables." -- Murphy's Law of Mathematics
--- GoldED/2 3.0.1
* Origin: Windows98 is a graphic DOS extender (2:500/143.7)
+----------------------------------------------------------------------------+
From: Eddy Thilleman 10-Oct-99 21:38:00
To: All 11-Oct-99 23:10:20
Subj: start wget
Hello All,
the for...in...do that calls (in the same session) or starts (in a separate
session) the wgetmir.cmd REXX file in combination with redirection to nul
results in weird behavior (the log file names gets a space in the middle and
the log output of wget is placed in the file with the url's listed). I don't
know why this is, it took some time before I found the solution: leave out the
redirection.
------------------- begin of startwget.cmd -------------------
@echo off
c:
cd \www
call cheap
if not errorlevel 1 exit
if exist wget.ftp call wgetftp
for %%a in (wget*mirror) do call wgetmirror %%a
for %%a in (wget*mir) do call wgetmir %%a
for %%a in (wget*news) do start /win /c /b wgetnews %%a
for %%a in (wget*www) do start /win /c /b wgetwww %%a
for %%a in (wget*x) do start /win /c /b wgetx %%a
exit
-------------------- end of startwget.cmd --------------------
In wgetmir.cmd I use the arg() function instead the arg keyword to get the
filename to prevent the filename is uppercased (parse arg would do too
according to the REXX INF file).
Greetings -=Eddy=- email: eddy.thilleman@net.hcc.nl
... Windows? Honey don't play that!
--- GoldED/2 3.0.1
* Origin: Windows98 is a graphic DOS extender (2:500/143.7)
+----------------------------------------------------------------------------+
From: Francois Massonneau 11-Oct-99 08:35:04
To: All 12-Oct-99 06:42:22
Subj: FrontDoor/Mailser and Rexx
Hello !
This is a question I 've just asked in the FrontDoor echo, but I guess someone
in this one can help me to succeed in this process, as everything could be
manage by a rexx script.
This is the question :
>------------------------------------------------------------------------------
----------------
I need to run a mail server every 3 and a half hours and I would like :
- front door to exit, (I use a .BAT file to run frontdoor (2.30mL)).
- then run the Rexx Script (I 'm using OS/2) that takes care of my mail
server,
- wait for the script to complete (sometimes, it takes 3 or 4 minutes,
but sometimes it takes longer).
- kill all applis that have been launched by the script, and the script
itself, if it takes more that xx minutes (as I'm charged for every minutes on
line, I can't afford to stay connected to my ISP if something goes wrong with
it).
- then check the com port (I saw that from time to time some problems
occur when the script ended).
- then restart frontdoor if everything above is ok, else, kill all the
nodes (I run a two nodes BBS), and restart them.
I know there is a program to kill which name is "GO.EXE"(go -k appli.exe) but
I saw that from time to time, when I want to kill an appli (I use it to kill
InetMail, pop3d.exe, smtpd.exe and In-joy.exe), it kill my node 1 (which runs
on my com1, !! (((-: )
I use HSTART to start an OS/2 appli from a dos batch file too.
So the questions :
1) does someone can help me and show me what are the lines I have to add to my
batch file that runs that node to do what I need above and secure the whole
process (I have to leave my system on its own for 3 or 4 weeks maybe more
(when you enter in an hospital you don't know when and how you go out ;-( ) ?
2) (deleted as it's off topic with this echo)....../.
>------------------------------------------------------------------------------
----------------
in the next message I'm gonna post the script I use to run this mail server.
I'm sorry it's a long script but many told me to post it in this echo, so I'm
gonna do it, and ask the problems I have with it.
Bye, Francois!
Email: fmas@celtes.com
Web : http://www.worldnet.net/~island/
---
* Origin: Island's BBS, a Node in the Atlantic Ocean (2:326/2)
+----------------------------------------------------------------------------+
From: Francois Massonneau 11-Oct-99 08:42:04
To: All 12-Oct-99 06:42:23
Subj: (1/2) The Dialup (dve.cmd) script
Hello !
First, I have to apologize, because it's a very, very long message
Second, I'm a total newbie with rexx, so in your reply, please give me the
exact lines of code, as I won't be able to deal with just advices, I'm too
short in time, as I have to leave home in 15 days.
This is the script I use to run my mail server, the questions are after it :
>==============================================================================
=========
/* REXX script for InetMail - Written by Paul Hethmon, and modify by many
people */
/*
* This program designed to control Inet.Mail in a dialup situation.
*
* Orignial Script available at:
* ftp://ftp.hethmon.com/hethmon/pub/scripts/dialup.zip
*
* This script depends on two external programs:
*
* etrn.exe -- Available from Hethmon Brothers
* ftp://ftp.hethmon.com/hethmon/pub/scripts/etrn.zip
*
* go.exe -- Available from Hethmon Brothers
* ftp://ftp.hethmon.com/hethmon/pub/scripts/go.zip
*
* When you start Inet.Mail, you must use 3 command line flags:
*
* -ready
* -queue
* -relay
*
* You must also create two files in the Inet.Mail main directory:
*
* noqueue
* norelay
*
* The file contents do not matter. A simple way of creating them is
* to redirect the output of the dir command: dir > noqueue
*
* These two files are used as flag files to communicate between this
* script and Inet.Mail.*/
/* ------------------------ Beginning of Variable declarations
-------------------------------- */
/* This section of variables must be set to local values. */
InetMailDir = 'f:\inetmail' /* Your InetMail directory */
DialerDir = 'e:\injoy' /* Your Dialer directory */
SemaforeDir = 'c:\fd\sem' /* The directory where you want a
semafore file to */
/* be created */
DialupLogFile = 'f:\inetmail\dialup.log' /* The logfile and its path */
SleepTime = (60 * 225 * 1) /* Amount of time between
connections in seconds */
/* template : seconds * minutes *
hours */
RemoteServer = 'relay.worldnet.net' /* Remote server to contact for mail
download */
/* Must be an ip name. */
MailDomains = 'celtes.com' /* The mail domain the remote server
is queueing for. */
/* This is the name of your mail
domain as in */
/* user@domain.com would be
domain.com. You may enter */
/* multiple ip names here as needed.
Every domain you */
/* have email queued for must be
listed. */
ImRelayFile = InetMailDir||'\norelay' /* Inet.Mail relay file. The file is
always called */
/* "norelay". Just add the full path
to it here. */
ImReadyFile = InetMailDir||'\ready' /* Inet.Mail ready file. The file is
always called */
/* "ready". Just add the full path
to it here. */
ImQueueFile = InetMailDir||'\noqueue' /* Inet.Mail queue file. The file is
always called */
/* "noqueue". Just add the full path
to it here. */
SpoolDir = InetMailDir||'\spool' /* Inet.Mail spool Directory. The
file is always */
/* *.spl. Just add the full path to
it here. */
Etrn = InetMailDir||'\etrn.exe' /* ETRN program */
DialerProg = 'In-joy.exe' /* Your Dialer Program */
DialIsp = DialerDir||'\in-joy.exe auto' /* If your dialer needs any command
line parameters to */
/* automatically dial, then place
them here */
KillDialer = DialerDir||'\killjoy.exe' /* Kill program to hangup the
dialer. If your dialer */
/* has a command which will cause it
to hang up. You */
/* may substitute it here*/
CheckIfRunning = 'go.exe -cp' /* Program to run to check if an
appli is running */
kill = 'go.exe -k' /* Kill program to kill The applis
that could run and */
/* need to be killed. */
SemaMailer = SemaforeDir||'\inetmail.sem' /* Name, Drive and Directory of the
semafore file you */
/* want the script to create once it
has run */
InetMail=inetmail /* define apps */
pop3d=pop3d /* define apps */
smtpd=smtpd /* define apps */
FireUpIM = InetMailDir||'\'||InetMail ' -l -vis -checkpoint -relay -ready
-queue -hops 30' /* How */
/* you fire up InetMail, and which
parameters do you */
/* need for it */
/* --------------------------- End of Variable declarations
----------------------------------- */
/* For non english speaking user : we change the day given in the log file
from english to french */
DayoftheWeek = date('W')
if DayoftheWeek = 'Sunday' then
JourdelaSemaine = 'Dimanche'
if DayoftheWeek = 'Monday' then
JourdelaSemaine = 'Lundi'
if DayoftheWeek = 'Tuesday' then
JourdelaSemaine = 'Mardi'
if DayoftheWeek = 'Wednesday' then
JourdelaSemaine = 'Mercredi'
if DayoftheWeek = 'Thursday' then
JourdelaSemaine = 'Jeudi'
if DayoftheWeek = 'Friday' then
JourdelaSemaine = 'Vendredi'
if DayoftheWeek = 'Saturday' then
JourdelaSemaine = 'Samedi'
/* End of the french translation */
CurDir = directory()
/* Set to 1 to enable debug output */
Debug = TRUE
/* Set to 1 to enable logging */
Log = TRUE
DialupVersion = 'v.1.6'
DialupRevision = '0.07'
DialupDate = '11 October 1999'
high = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
low = 'abcdefghijklmnopqrstuvwxyz'
Env = 'OS2ENVIRONMENT'
FALSE = 0
TRUE = 1
CRLF='0d0a'x
Start = 'start'
/* Rexx Socket variables */
domain = 'AF_INET'
server.!family = 'AF_INET'
server.!port = 25
server.!addr = RemoteServer
/* The external functions we need */
call RxFuncAdd 'SysCls', 'RexxUtil', 'SysCls'
call RxFuncAdd 'SysFileDelete', 'RexxUtil', 'SysFileDelete'
call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'
call RxFuncAdd 'SysSleep', 'RexxUtil', 'SysSleep'
call RxFuncAdd 'SockLoadFuncs', 'rxSock', 'SockLoadFuncs'
rc = SockLoadFuncs()
rc = SockInit()
/* start main function, we ignore any arguments */
/* Endless loop */
do while 1
/* We start the dial process, so it's time to write the log file */
call LINEOUT DialupLogFile, ' '
call LINEOUT DialupLogFile, '------/' 'DialUp Script' DialupVersion
'rev.'DialupRevision ':' JourdelaSemaine date() '-' Time() '/------'
call LINEOUT DialupLogFile, ' '
call LINEOUT DialupLogFile, date() time() 'Started dialup up process ...'
/* lets attempt to shutdown dialer and mail server; in case it's running
already */
/* we should really test if it runs 1st... but, we'll just 'dumb kill all'
for now */
call SysCls
say '--------------------------------------------------------------------'
say '...we will try to shutdown dialer and mail server before we start...'
say '--------------------------------------------------------------------'
call LINEOUT DialupLogFile, date() time() ' dialer, if running, is
killed.'
KillDialer
call SysSleep(2)
call LINEOUT DialupLogFile, date() time() ' inetmail, if running, is
killed.'
kill inetmail
call SysSleep(2)
call LINEOUT DialupLogFile, date() time() ' pop3d process, if running, is
killed.'
kill pop3d
call SysSleep(2)
call LINEOUT DialupLogFile, date() time() ' smtpd process, if running, is
killed.'
kill smtpd
call SysSleep(2) /* just give it a little time to shut down... */
/* Check for time of day - if outside business hours don't do anything */
/* Check for day of week - if Saturday or Sunday don't do anything */
/* IF (time('H') < '05:00:00') | (time('H') > '22:00:00') | (date('Base')//7
> 4) then do
say "Outside working hours. Sleeping..."
call SysSleep(SleepTime)
iterate
end
else
*/
/* First we have to change to the Dialer directory */
newdir = directory(DialerDir)
/* Start the dialer */
call SysCls
say '--------------------------------------------------------------------'
say 'Starting dialer ... '
say '...starting InJoy dialer in another session... '
say '--------------------------------------------------------------------'
call LINEOUT DialupLogFile, date() time() '. Starting the Internet Dialer
...'
Start '"Internet Dialer" /C' DialIsp
/* return to script directory */
newdir = directory(CurDir)
/* We 're testing the server */
/* We give dialer some time to negotiate and complete connection, then, start
testing if TCP/IP is 'UP' */
say "...let's sit'n'wait till connection is established before we try
anything..."
say '...testing if a link has been established...'
DO ii=1 to 24 /* test for connection up to 24*5 = 120 seconds */
rc = SockGetHostByName(RemoteServer, "host.!")
if (rc = 1) then do
say '..we can resolve hostnames, connection is up...'
call LINEOUT DialupLogFile, date() time() ' We can resolve hostnames,
connection is up...'
call directory InetMailDir
call LINEOUT DialupLogFile, date() time() ' InetMail, Pop3d and Smtpd are
started...'
'@start ' FireUpIM /* We have to restart InetMail */
call SysSleep(1)
call directory CurDir
leave
end
say '...no connection yet, wait, then test again...'
call LINEOUT DialupLogFile, date() time() ' warning ! no connection yet,
wait, then test again...'
call SysSleep(5)
end /* do */
/* Check for a live connection */
say '--------------------------------------------------------------------'
say 'Check for a live connection, starting mail processing ... '
say '--------------------------------------------------------------------'
call LINEOUT DialupLogFile, date() time() '. Starting of the PingServer
procedure ...'
rc = PingServer()
/* a rc of 0 means we can connect, so start some stuff */
if (rc == 0) then do
/* We need to delete the queue file, otherwise smtpd will*/
/* never wake up and check the queue for mail to be sent */
say 'Deleting the outgoing mail queue flag file...'
call LINEOUT DialupLogFile, date() time() ' deleting the outgoing Mail
Queue Flag.'
rc = SysFileDelete(ImQueueFile);
/* Start the etrn program to pick up the new mail waiting */
say 'Starting etrn program ...'
call LINEOUT DialupLogFile, date() time() '. sending the ETRN signals ...'
do i = 1 to words(MailDomains)
TmpDomain = word(MailDomains, i)
etrn RemoteServer TmpDomain
end
/* We need to wait for at least the time between queue checks */
/* for the outgoing mail process to start delivering mail and */
/* delete the ready file before we check for its existence. */
call LINEOUT DialupLogFile, date() time() ' sleeping for 30 seconds ...'
Call SysSleep(30)
/* Now wait for Inet.Mail to tell us it is done sending the */
/* queued mail by checking for the existence of the ready file*/
say 'Waiting for queue delivery to complete ...'
call LINEOUT DialupLogFile, date() time() ' waiting for queue delivery to
complete ...'
Waiting = TRUE
do while (Waiting == TRUE)
rc = SysFileTree(ImReadyFile, "s.", 'F')
if (s.0 == 1) then Waiting = FALSE
end
say 'Queue delivery complete.'
call LINEOUT DialupLogFile, date() time() ' queue delivery complete ...'
/* Now we check that incoming mail delivery has completed.*/
/* by checking for the presence of *.spl in the spool directory.*/
/* Now we check that incoming mail delivery has completed.*/
/* by checking for the presence of *.spl in the spool directory.*/
Incoming = TRUE
call LINEOUT DialupLogFile, date() time() ' waiting for Incoming mail
delivery to complete ...'
do while (Incoming == TRUE)
rc = SysFileTree(SpoolDir'\*.spl', files., 'FO')
if (files.0 == 0) then Incoming = FALSE
call LINEOUT DialupLogFile, date() time() ' now waiting for 30 seconds
...'
call SysSleep(30) /* We wait a little bit for the server to send the mail
*/
end
say 'Incoming mail delivery complete.'
call LINEOUT DialupLogFile, date() time() ' incoming mail delivery
complete ...'
/* Recreate the queue file to put the queue check process */
/* back to sleep. */
call LINEOUT DialupLogFile, date() time() ' recreating the noqueue flag
file.'
rc = stream(ImQueueFile, 'c', 'open')
rc = lineout(ImQueueFile, 'noqueue')
rc = stream(ImQueueFile, 'c', 'close')
end
else do
call LINEOUT DialupLogFile, date() time() '. Warning : Unable to connect to
remote Sever. Skipping connection.'
say 'Unable to connect to remote server. Skipping connection.'
call LINEOUT DialupLogFile, date() time() ' and we go to sleep for a while
- 10 seconds.'
call SysSleep(10)
end
/* Now kill the dialer. Crude but necessary. */
say 'Hanging up the dialer...'
call LINEOUT DialupLogFile, date() time() '. Hanging up ...'
/* get current directory */
curdir = directory()
/* go stop injoy */
newdir = directory(DialerDir)
call LINEOUT DialupLogFile, date() time() ' we kill the Dialer, Crude but
necessary ...'
KillDialer
call SysSleep(2)
call LINEOUT DialupLogFile, date() time() ' InetMail is killed.'
kill InetMail
call SysSleep(2)
call LINEOUT DialupLogFile, date() time() ' Pop3d process is killed.'
kill pop3d
call SysSleep(2)
call LINEOUT DialupLogFile, date() time() ' Smtpd process is killed.'
kill smtpd
/* return to script directory */
newdir = directory(CurDir)
call LINEOUT DialupLogFile, date() time() '. Sleeping for' SleepTime
'seconds...'
call LINEOUT DialupLogFile, date() time() 'End of the script'
call LINEOUT DialupLogFile
/* And we will take some rest before working again */
say '--------------------------------------------------------------------'
say 'Sleeping for' SleepTime 'seconds at' time() 'on' date() '...'
say '--------------------------------------------------------------------'
call SysSleep(SleepTime)
/* Now it's time to create the semafore file your mailer is waiting */
rc = stream(SemaMailer, 'c', 'open')
rc = lineout(SemaMailer, 'inetmail semafore file')
---
* Origin: Island's BBS, a Node in the Atlantic Ocean (2:326/2)
+----------------------------------------------------------------------------+
From: Francois Massonneau 11-Oct-99 08:42:04
To: All 12-Oct-99 06:42:23
Subj: 2 (1/2) The Dialup (dve.cmd) script
rc = stream(SemaMailer, 'c', 'close')
end /* This is the End of the Do for the Endless Loop */
/* exit */
/* ------------------------------------------------------ */
/* ---------------------------------------------- */
/* This function makes a connection to the remote mail server to */
/* check that the dialup connection has been made successfully. */
PingServer: procedure expose server. domain RemoteServer CRLF
say 'PingServer'
iTimes = 0
iRc = 1
rc = SockGetHostByName(RemoteServer, "host.!")
if (rc = 0) then do
say 'Unable to resolve hostname'
call LINEOUT DialupLogFile, date() time() 'Unable to resolve hostname ...'
return iRc
end
/* save the ip address */
server.!addr = host.!addr
do while (iTimes < 30)
say 'save the IP address ...'
if (iTimes > 0) then do
call SysSleep(10) /* go to sleep for a while - 10
seconds */
end
/* create a new socket */
say 'Creating socket ...'
sock = SockSocket('AF_INET', 'SOCK_STREAM', 0)
if (sock < 0) then do
iTimes = iTimes + 1
iterate
end
/* connect to the remote server */
say 'Connecting to server ...'
call SysSleep(15) /* go to sleep for a while - 15
seconds */
rc = SockConnect(sock, "server.!")
if (rc < 0) then do
say 'Error on SockConnect =' errno
rc = SockClose(sock)
iTimes = iTimes + 1
iterate
end
/* get the greeting */
say 'Getting the greeting ...'
rc = SockRecv(sock, greeting, 1024)
if (rc < 0) then do
rc = SockClose(sock)
iTimes = iTimes + 1
iterate
end
say 'Server greeting: ' greeting
/* Send a nice reply */
rc = SockSend(sock, 'ehlo'CRLF)
if (rc < 0) then do
rc = SockClose(sock)
iTimes = iTimes + 1
iterate
end
/* get the response */
rc = SockRecv(sock, greeting, 1024)
if (rc < 0) then do
rc = SockClose(sock)
iTimes = iTimes + 1
iterate
end
say 'Server helo response: ' greeting
/* And a closing response */
rc = SockSend(sock, 'quit'CRLF)
if (rc < 0) then do
rc = SockClose(sock)
iTimes = iTimes + 1
iterate
end
/* Must have completed ok */
iRc = 0
leave
end
return iRc
/* end of function */
/* ------------------------------------------------------ */
>==============================================================================
=========
And now the first questions :
1°) At the beginning of the script you find those lines :
KillDialer
call SysSleep(2)
kill inetmail
call SysSleep(2)
kill pop3d
call SysSleep(2)
kill smtpd
(I've removed the lineout lines).
As you can see, I kill, using "go.exe", four applis (the dialer,
Inetmail, pop3d and smtpd).
I would like first to kill them, ONLY if they run.
Actually the script tries to kill them each time it is run, and the output
gives some error warnings (the script works but I do not like those
warning) . This is what I get :
--------------------------------------------------------------------
...we will try to shutdown dialer and mail server before we start...
--------------------------------------------------------------------
[E:\tmp]e:\injoy\killjoy.exe
[E:\tmp]go.exe -k INETMAIL
GO! v1.5 - (c) 1993-95 by Carsten Wimmer <cawim@train.oche.de>
Querying pid for process <INETMAIL.EXE> ... Error ...
[E:\tmp]go.exe -k POP3D
GO! v1.5 - (c) 1993-95 by Carsten Wimmer <cawim@train.oche.de>
Querying pid for process <POP3D.EXE> ... Error ...
[E:\tmp]go.exe -k SMTPD
GO! v1.5 - (c) 1993-95 by Carsten Wimmer <cawim@train.oche.de>
Querying pid for process <SMTPD.EXE> ... Error ...
How can I modify the script to launch that kill function only if the
appli to kill is running ?
(I have added to the script the variable "CheckIfRunning" but I didn't add the
lines for it into the code itself).
2°) What are the lines to add to the script to have it to calculate the time
online. The script gives me the time it is for each process it is executing,
but I would like it to calculate the exact time I'm connected to my provider,
and with the cost of each minute connected, I would be able to know exactly
how much it costs me. (I'm charged about 0.25 $ per mn).
Would it be possible to have something like that (see below) in the log file :
11 Oct 1999 03:11:55 . Sleeping for 13500 seconds...
11 Oct 1999 03:11:55 End of the script
11 Oct 1999 03:11:55 Total time connected for this run : 3' 25". Cost : 0.75$
3°) I've just taken a look at the log file, and this is what I saw ;-( :
----/ DialUp Script v.1.6 rev.0.05 : Jeudi 7 Oct 1999 - 18:34:36 /---
7 Oct 1999 18:34:36 Started dialup up process ...
7 Oct 1999 18:34:36 dialer, if running, is killed.
7 Oct 1999 18:34:37 inetmail, if running, is killed.
7 Oct 1999 18:34:38 pop3d process, if running, is killed.
7 Oct 1999 18:34:39 smtpd process, if running, is killed.
7 Oct 1999 18:34:42 . Starting the Internet Dialer ...
7 Oct 1999 18:34:43 We can resolve hostnames, connection is up...
7 Oct 1999 18:34:43 InetMail, Pop3d and Smtpd are started...
7 Oct 1999 18:34:44 . Starting of the PingServer procedure ...
7 Oct 1999 19:33:56 . Warning : Unable to connect to remote Sever.
Skipping connection.
7 Oct 1999 19:33:56 and we go to sleep for a while - 10 seconds.
7 Oct 1999 19:34:06 . Hanging up ...
7 Oct 1999 19:34:06 we kill the Dialer, Crude but necessary ...
7 Oct 1999 19:34:07 InetMail is killed.
7 Oct 1999 19:34:10 Pop3d process is killed.
7 Oct 1999 19:34:11 Smtpd process is killed.
7 Oct 1999 19:34:11 . Sleeping for 10800 seconds...
7 Oct 1999 19:34:11 End of the script
As you can see, 6.34pm : Starting of the PingServer Procedure
BUTTTTTTTT, 7.33 pm Warning : Unable ;.....
ONE HOUR LATER ;-(((((((((
I've to pay for ONE HOUR ;-(
Is there a way to have the script to check the com port or something
else, but I would like to have more secure ;-(((
4°) This is an example of a problem I have from time to time :
I started the script, but Injoy hang up after running out of time. ( I setted
up its timer to 5 minutes.
In the window the script was running, I've got the following output :
>------------------------------------
--------------------------------------------------------------------
Starting dialer ...
...starting InJoy dialer in another session...
--------------------------------------------------------------------
[E:\injoy]start "Internet Dialer" /C e:\injoy\in-joy.exe auto
...let's sit'n'wait till connection is established before we try
anything...
...testing if a link has been established...
..we can resolve hostnames, connection is up...
--------------------------------------------------------------------
Check for a live connection, starting mail processing ...
--------------------------------------------------------------------
PingServer
Creating socket ...
Connecting to server ...
Error on SockConnect = ETIMEDOUT
Creating socket ...
Connecting to server ...
Getting the greeting ...
>----------------------------------
And the things stayed that way forever ;;-(
The script seems to wait for the greeting, but Injoy was stopped.
How can I tell the script to kill everything after a while if
something like that happens ???
5°) Another kind of problem :
Sometimes, in the window the script is running, the script seems to be
frozen (?) as it displays :
PingServer
Creating socket ...
Connecting to server ...
Getting the greeting ...
Injoy is well connected, but I setted up the time to 5 minutes. (I pay
for every second I stay on line). The time has run out, then Injoy
has disconnected, but the script was always showing the same line :
"Getting the greeting....".
Injoy has restarted, connect to my isp and wait for the timer to run
out (5 minutes again)., but the script was always waiting for the
"greeeting", and things stayed that way, injoy has disconnected, then
restart, etc....
As I have to run this script in an unattended way, it's impossible to
have the things to run that way;
What are the changes to do ?
I guess, it's enough for a first message. Really, thank you to all of you who
will be able to help me to make that script strong enuf to run by itself and
in a secure way for one month.
Bye, Francois!
Email: fmas@celtes.com
Web : http://www.worldnet.net/~island/
---
* Origin: Island's BBS, a Node in the Atlantic Ocean (2:326/2)
+----------------------------------------------------------------------------+
From: Ron Mitchell 11-Oct-99 21:34:29
To: Rich Wonneberger 12-Oct-99 07:57:12
Subj: hstart wget?
Rich Wonneberger wrote in a message to Ron Mitchell:
RW> Thanks for the lesson.
Don't thank me. Thank Charles Daney. His 'Programming in REXX' book is the
best investment I've ever made in a programming book.
RW> Is there any way to get a non case sensitive comparison??
I don't think so.
Probably the best way to do it is to copy both operands to temporary variables
and then convert these variables to lower or upper case before you compare.
Daney seems to like converting to lower case. I don't know why yet.
You can drop the temporary variables and use the original operands however you
wish depending on the outcome of the compare.
L8r,
Ron
... Become a programmer - Make a living crashing your computer.
---
* Origin: River Canyon Rd. BBS Chattanooga,TN 423-886-2521 (1:362/627)
+----------------------------------------------------------------------------+
From: John Clarke 10-Oct-99 18:50:26
To: Ron Mitchell 12-Oct-99 21:15:10
Subj: hstart wget?
On Oct 09, 1999 at 05:24 hrs, Ron Mitchell of 1:362/627 wrote to John Clarke:
Hello Ron,
RM> John Clarke wrote in a message to Jonathan de Boyne Pollard:
JdBP>> If it helps, the TEE in OS2CLU02.ZIP doesn't require any non-system
JdBP>> DLLs other than the one that is supplied along with it in the very
JdBP>> same archive.
JC>> I would appreciate it if you would email a copy of this file to me
JC>> at the email address below or point me towards a place where I can
JC>> grab it from the 'net.
RM> You can pick it up at http://www.riverbbs.net in the files section.
RM> Also at telnet://riverbbs.net.
Thanks. I picked up a copy from Hobbes.
Regards ... John
Email: jclarke@zip.com.au
--- MsgedSQ/2 3.30
* Origin: The Clearing House (3:713/730)
45
+----------------------------------------------------------------------------+
From: Rich Wonneberger 12-Oct-99 20:24:00
To: Ron Mitchell 13-Oct-99 06:57:09
Subj: hstart wget?
*** Quoting Ron Mitchell to Rich Wonneberger dated 10-11-99 ***
> RW> Is there any way to get a non case sensitive comparison??
>
> I don't think so.
>
> Probably the best way to do it is to copy both operands to temporary
> variables and then convert these variables to lower or upper case
> before you compare. Daney seems to like converting to lower case. I
Ron,
Sounds like this can be done in REXX easier then batch.
Gota look in the help files.
Thanks
Rich
I-Net turtil@frontiernet.net
... ▓▓▓▓▓▓▓▓▓ <- Scratch Here For Your Instant Tagline Prize!
---
* Origin: Turtil's Pond BBS. Monroe NY. 914-783-2106 (1:2625/50)
+----------------------------------------------------------------------------+
From: MIKE RUSKAI 12-Oct-99 09:50:00
To: RON MITCHELL 13-Oct-99 11:13:15
Subj: hstart wget?
Some senseless babbling from Ron Mitchell to Rich Wonneberger
on 10-11-99 21:34 about hstart wget?...
RM> Rich Wonneberger wrote in a message to Ron Mitchell:
RW> Thanks for the lesson.
RM> Don't thank me. Thank Charles Daney. His 'Programming in REXX' book
RM> is the best investment I've ever made in a programming book.
RW> Is there any way to get a non case sensitive comparison??
RM> I don't think so.
RM> Probably the best way to do it is to copy both operands to temporary
RM> variables and then convert these variables to lower or upper case
RM> before you compare. Daney seems to like converting to lower case. I
RM> don't know why yet.
RM> You can drop the temporary variables and use the original operands
RM> however you wish depending on the outcome of the compare.
FYI, using a temporary variable isn't necessary. Simply wrap the variable
inside a translate() call (or put a ~translate at the end of the message
chain, in Object REXX), like this:
string1='something'
string2='SoMeThInG'
say translate(string1)==translate(string2)
Mike Ruskai
thannymeister@yahoo.com
... Does that look like a slut to you, Beavis?
___ Blue Wave/QWK v2.20
--- Platinum Xpress/Win/Wildcat5! v3.0pr2
* Origin: FIDO QWK MAIL & MORE! WWW.DOCSPLACE.ORG (1:3603/140)
45
+----------------------------------------------------------------------------+
From: David Noon 13-Oct-99 18:11:01
To: Rich Wonneberger 15-Oct-99 06:08:04
Subj: comparison operators
In a message dated 10-09-99, Rich Wonneberger said to David Noon about
"hstart wget?"
Hi Rich,
> Note the double equal sign.
RW>I've seen the double equal sign in DOS batch program. What
RW>does this do thats different then single equal?
In simplest terms, a single equal sign asks if the values are equal, whereas
a double equal sign asks if the bytes are exactly the same. Thus,
"A" = " A " is true
"A" == " A " is false
2 = 2.0 is true
2 == 2.0 is false
25 = 2.5E+1 is true
25 == 2.5E+1 is false
All character comparisons are case-sensitive. To make a case-insensitive
comparison use the TRANSLATE() built-in function. For example,
IF TRANSLATE(string_1) = TRANSLATE(string_2) THEN ...
performs a case-insensitive comparison of the variables string_1 and
string_2.
Regards
Dave
<Team PL/I>
___
* MR/2 2.25 #353 * I use Windows...on my car, on my house, but not on my ...
--- Maximus/2 3.01
* Origin: Air Applewood, OS/2 Gateway to Essex 44-1279-792300 (2:257/609)
45
+----------------------------------------------------------------------------+
From: Murray Lesser 15-Oct-99 16:09:00
To: David Noon 15-Oct-99 16:09:00
Subj: Rxprep
Hi David--
Do you have any comments, helpful or otherwise, about RXPREP? This
is a preprocessor for REXX source code, written (in REXX) by Richard J.
Moore of IBM UK. The following paragraph is an excerpt from the
introduction to RXPREP.DOC, as it appears in the July, 1999, CD-ROM
issue of DevCon Release 2 Volume 3 (disc M15):
"RXPREP is a pre-processor for REXX source. It permits source to be
built from multiple members which are selected by imbedding
directives. Nesting of imbedded members is supported. Also supported
is the use of conditional inclusion of source or members as well as
substitution of placeholders specified either within the source or
from the command line. In fact the features of RXPREP mimic those
frequently found in C compiler pre-processors and assembler macro
languages. The pre-processor is controlled by coding directives within
the REXX source which have a syntactical resemblance to those of the
SCRIPT language."
(For those in the audience who are not familiar with IBM utilities
other than those furnished with OS/2, "SCRIPT" was a mainframe internal
IBM markup language for formatting documents written with any
lime-by-line text editor (often SPF). There was a vintage-1986
IBM-distributed shrink-wrapped version, SCRIPT/PC, for PC-DOS.)
A cursory reading of RXPREP.DOC leads me to the belief that the
advantages of a REXX preprocessor (even though it is free!) are not
great enough for me bothering to learn yet another language just to use
it, so I do not intend to install RXPREP. But I may be missing
something. Your comments would be appreciated.
Regards,
--Murray
<Team PL/I>
___
* MR/2 2.25 #120 * Which direction is forward?
--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)
+----------------------------------------------------------------------------+
+============================================================================+