home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
shackos2.zip
/
hacksaw.doc
< prev
next >
Wrap
Text File
|
1997-06-12
|
87KB
|
1,690 lines
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Hacksaw Version 1.0c
InnoVal Systems Solutions, Inc.
June 12, 1997
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hacksaw is a very useful character mode (command-line-based) tool for
people who deal with files on the internet. There are identical
versions for OS/2 and for Windows 95/NT. This tool can retrieve files
and headers from HTTP servers; send email to SMTP servers; check,
retrieve, and delete email from POP3 servers; and has many very
powerful functions for dealing with FTP servers. It can be used
interactively, asking you for the information it needs as it goes
along. Or the information can be given to it in an automated fashion,
so that it can be activated by a scheduler program (like InnoVal's own
WebSched) in the middle of the night while you're asleep.
If you type HACKSAW by itself or with ? as its argument at the command
line, it will show you a summary of its syntax. However, please don't
try to use that summary alone, to figure out how to use HACKSAW. It
won't make very much sense unless you've read this document first.
Besides, you'll also be missing out on a lot of HACKSAW capabilities
that aren't explained there. (That summary screen is also reproduced
at the end of this document, for your convenience.)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to Install
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Just put the HACKSAW.EXE file into a directory that's on your PATH.
That's all there is to it.
Unless you want to be able to run both the Windows 95/NT version and the
OS/2 version on the same machine. In that case, there are two ways you
can do it. Your can put the OS/2 version of HACKSAW.EXE into a
directory that's on your OS/2 PATH but not on your Windows or NT PATH,
and vice versa; in which case each of those directories will have its
own HACKSAW.INI file and you'll need to copy it from one directory to
the other each time you make a change to it, if you want them to be
identical. Or you can keep both HACKSAW.EXE files in the same directory
if you rename the OS/2 version to HACKOS2.EXE, or rename the Windows
version to HACKWIN.EXE, and execute HACKOS2 and HACKWIN commands instead
of HACKSAW commands. In this case, both versions will be using the same
copy of the HACKSAW.INI file.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
How to Use
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
In order to tell HACKSAW what you want it to do, you must give it some
command line arguments. Either:
1. The name of a control file which has COMMAND and SUBCOMMAND
arguments on its first line (see the CONTROL FILES section of
this document for more information), or
2. A command and a subcommand, and optionally other arguments
The HACKSAW commands tell HACKSAW what kind of server it's going to
deal with. The choices are:
1. FTP to interact with an FTP server
2. HTTP to interact with an HTTP server
3. EMAIL to interact with an SMTP or POP3 server
4. DEFINE to store data in the HACKSAW.INI file
The subcommands tell HACKSAW what you want to do with that server.
The available FTP subcommands are:
1. SEND
2. SENDALL
3. SYNCHRONIZEHOST
4. RETRIEVE
5. RETRIEVEALL
6. SYNCHRONIZELOCAL
7. LIST
8. DELETE
9. RENAME
10. SITECOMMAND
The available HTTP subcommands are:
1. RETRIEVE
2. RETRIEVEHEADERS
The available EMAIL subcommands are:
1. SEND
2. MAILWAITING
3. RETRIEVE
4. DELETE
The DEFINE subcommands are:
1. DEFAULT_USERID
2. PASSWORD
3. DEFAULT_MAILUSER
4. DEFAULT_MAILFROM
5. SMTP_SERVER
6. POP3_SERVER
7. FTP_SERVER
8. FTPPROXY_SERVER
9. HTTPPROXY_SERVER
10. FTPPROXY_PORT
11. HTTPPROXY_PORT
12. PROXY
13. PROXY_IGNORE_FILE
14. VARIABLE
Once you've given HACKSAW a command and a subcommand, there are four
ways of giving the program the rest of the information it needs:
1. Prompting
2. The HACKSAW.INI file
3. Command line arguments
4. Control files
These methods can be used in any combination. That is, you can
specify some of the arguments at the command line and others in a
control file, etc. However, if you have the same argument specified
in more than one place, the only one that will be used will be the one
closer to the bottom of the above list. For example, the program
won't look for something in the HACKSAW.INI file unless it was not
found in a control file nor in the command line arguments. And the
program won't pay attention to a command line argument, if the same
argument was also specified, with a different value, in the control
file.
HACKSAW commands, subcommands, arguments, and variables are all
completely case insensitive. That is, "FTP" and "ftp" are seen as
identical; "SEND" and "send" are seen as identical; "HostFile" and
"hOsTfIlE" are seen as identical; and "&MyGifDir" and "&MYGIFDIR" are
seen as identical. But remember, most FTP servers run on a UNIX
operating system, and under UNIX, filenames and directory names are
case sensitive. So if you tell HACKSAW to retrieve "filename.htm" and
the file's name on the server machine is "FILENAME.HTM", or vice versa,
it isn't going to work unless the server is one which does not see
filenames as being case sensitive.
1. Prompting
If your control file, command line arguments, and HACKSAW.INI file do
not include all the information HACKSAW needs in order to perform the
function you've told it to perform, it will prompt you for all the
other required arguments, one item at a time. For example, if you
type HACKSAW FTP DIR at the command line, HACKSAW will ask you for the
FTP server's address and you'll type that, then HACKSAW will ask you
for your userid and you'll type that, then HACKSAW will ask you for
your password and you'll type that, etc. But there's no way to enter
an optional argument using the prompting method. HACKSAW only prompts
for required arguments, not optional ones. So if you want to use an
optional argument, you must specify it via one of the other methods.
If you press the ESC key at any time during the prompting process,
HACKSAW will exit.
2. The HACKSAW.INI File
HACKSAW can keep a default FTP server and userid; passwords for
multiple FTP, HTTP, and POP3 userids; default from address and SMTP
server for sending email; default POP3 server, userid, and password
for retrieving email; a server name and port number for an FTP proxy
server and an HTTP proxy server; a setting for whether or not proxy
support is currently on or off; and a setting for servers for which you
want your proxy support to be ignored, in the HACKSAW.INI file. (You
use HACKSAW's DEFINE command to put them there.) So any time you don't
supply these arguments in a control file or on the command line,
HACKSAW will look for them in that file. If they're not there either,
it will prompt you for the required ones during execution.
3. Command line arguments
If you don't want HACKSAW to prompt you for the arguments that it
doesn't have stored in the HACKSAW.INI file (or if you want to
temporarily override an entry in that file), one of your options is to
feed it the information as command line arguments. A HACKSAW argument
must be specified as an argument name, followed (without a space) by
the argument value in parentheses. For example, to tell HACKSAW the
userid and password to use for an FTP SEND operation, you might say:
HACKSAW FTP SEND USERID(innoval) PASSWORD(secret)
(Don't worry, you don't have to include your password on the command
line or in the control file, for everyone to see, each time you issue
a HACKSAW command! You can use the DEFINE command to have HACKSAW
store a password in its HACKSAW.INI file, for each userid you have.
And of course, the passwords are encrypted before they're stored.)
You can leave off the closing parenthesis, if you like:
HACKSAW FTP SEND USERID(innoval PASSWORD(secret
You can type HACKSAW arguments in any order, since each argument has a
label that tells HACKSAW what it's supposed to be. So the following
example is exactly the same, as far as HACKSAW is concerned, as the
above two examples:
HACKSAW FTP SEND PASSWORD(secret) USERID(innoval)
There are also abbreviations or synonyms that you can use for most
HACKSAW commands, subcommands, and arguments. For example, PW is a
valid abbreviation for the PASSWORD argument and U is a valid
abbreviation for the USERID argument. So the following command is
equivalent to the previous ones:
HACKSAW FTP SEND PW(secret) U(innoval)
The recognized synonyms for each HACKSAW command and argument are
listed on the right side of HACKSAW's syntax screen. HACKSAW will
show you its syntax screen any time you execute it without arguments
or with ? as its argument at the command line. That screen is also
reproduced at the end of this document, for your convenience.
Elsewhere in this document, only the unabbreviated version of each
command, subcommand, and argument will be used, to avoid confusion; but
you can use any recognized abbreviation at any time.
Any time the value of an argument (what goes in parentheses) is more
than one word long (has a space in it), you must surround the value
with quotation marks. Otherwise, the operating system's command
interpreter will not send the argument to HACKSAW in the way that
HACKSAW can recognize it. For example:
HACKSAW FTP SEND LOCALFILE("e:\long named dir\filename.ext")
Don't forget that the & symbol has a special meaning to OS/2's command
interpreter (it separates one command from another on the same command
line), so if you need to include that symbol in a HACKSAW argument
under OS/2, you must surround it with quotation marks as well. This
way, CMD.EXE will ignore the & symbol and pass the entire argument to
HACKSAW the way you intended:
HACKSAW HTTP RETRIEVE LOCALFILE(results.txt)
HOSTFILE("qs.secapl.com/cgi-bin/qs?&tick=alyd")
Any command line argument that HACKSAW doesn't recognize as a valid
argument for the subcommand being processed, will be entirely ignored.
So if, for example, you were to use a SINCE argument with an FTP
SYNCHRONIZEHOST subcommand, the result would be exactly the same as if
you hadn't.
4. Control Files
Control files can be used for the same purpose command line arguments
are used, but they also have an ability that command line arguments do
not have: They can tell HACKSAW to perform the same function on
multiple files at once; to send multiple email messages at once; or to
retrieve email messages (perhaps from multiple POP3 accounts) into
multiple mail files at once. See the CONTROL FILES section of this
document for more information.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
FTP SUBCOMMANDS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
These arguments (shown with example values) are required for all FTP
subcommands:
HOST(ftp.innoval.com)
USERID(innoval)
PASSWORD(secret)
PORT(22) if your FTP server's port number is anything other than
the default of 21; which is rare, so most people do not need
this argument; but if you have an FTP server with a non-default
port, you'll need this argument for every HACKSAW FTP command
you use to reach that server
PROXYHOST(internet.innoval.com) if you have FTP access through a
firewall which uses the type of classical proxy software which
wants to receive the target server name as part of the userid;
for example userid@ftp.innoval.com; or if you have a proxy
server specified in the HACKSAW.INI file and you need for
HACKSAW to temporarily ignore it, specify "none" or "n" as the
server name here, or use the HACKSAW DEFINE PROXY subcommand to
turn off proxy support for a longer period of time, or use
HACKSAW DEFINE PROXY_IGNORE_FILE to specify certain servers for
which you always want proxy support to be ignored
PROXYPORT(22) if that proxy server's FTP port number is anything
other than the default of 21
Or you could put the arguments into a control file, and use only this
argument at the command line:
CONTROLFILE(e:\hacksaw\ctrlfile.001)
Optional arguments are:
HOSTDIRECTORY(/innoval)
LOCALDIRECTORY(e:\stuff)
When you need to tell HACKSAW the directory in which to find or place
a local file or a host file, you can do it in one of two ways. If
you're also specifying a filename to go along with that directory,
then you can specify the directory and filename together as part of
the LOCALFILE or HOSTFILE argument, like so:
LOCALFILE(e:\dirname\filename.ext)
Or you can specify just the filename in the LOCALFILE or HOSTFILE
argument, and use the HOSTDIRECTORY or LOCALDIRECTORY argument to
specify the directory name. For example, this line of arguments:
LOCALFILE(e:\stuff\filename.ext) HOSTFILE(/innoval/filename.new)
will cause the same result as the following:
LOCALFILE(filename.ext) LOCALDIRECTORY(e:\stuff)
HOSTFILE(filename.new) HOSTDIRECTORY(/innoval)
When a LOCALDIRECTORY is specified, it will be prepended to the
LOCALFILE argument (with a backslash). When a HOSTDIRECTORY is
specified, it will be prepended to the HOSTFILE argument (with a
slash). (Or if the target filename is not specified on an FTP command,
HACKSAW will use the part of the source filename past the last slash as
the target filename, before prepending the directory name to it.) Why
would one want to do this? In a control file, where you can have a
list of several files to act upon at once, you can use the
LOCALDIRECTORY or HOSTDIRECTORY argument to tell HACKSAW where the
files should be, and then each file argument only needs to contain the
filename, not the entire path to the file.
An even better use for these directory arguments is with & or $
variables. You can use the DEFINE VAR subcommand to assign the string
"/pub/company/thisdir/graphics" to the variable "MyGifDir". From then
on, any time you want to say "/pub/company/thisdir/graphics" to
HACKSAW, you need only tell it "&MyGifDir" or "$MyGifDir" (whichever
you like) instead. So you can say HOSTDIRECTORY(&MyGifDir) or
HOSTDIRECTORY($MyGifDir), and HOSTFILE(filename.gif), instead of
HOSTFILE(/pub/company/thisdir/graphics/filename.gif).
If you want the target file's name to be the same as the source file's
name, in an FTP SEND or RECEIVE operation, you don't have to specify it
in the HOSTFILE or LOCALFILE argument. But if you don't specify it,
and you do want to specify the target directory, you cannot use the
HOSTFILE or LOCALFILE argument for that purpose. You can only use
HOSTFILE or LOCALFILE in that way when the specification includes the
filename as well as the directory name. So if the target directory is
not the current directory of the local drive or the root directory of
the host (or the point of entry for the userid under which you logged
on), then you have no choice but to use the LOCALDIRECTORY or
HOSTDIRECTORY argument to specify it.
CHANGEDIRECTORY(/pub)
This argument can be used in place of HOSTDIRECTORY if you need for
HACKSAW to issue a CWD command to the FTP server before performing the
command.
PROXYIGNOREFILE(c:\hacksaw\servers.ign)
This argument can be used at the command line or via a control file,
but is much more likely to be used more permanently via a HACKSAW
DEFINE PROXY_IGNORE_FILE subcommand. It is useful, though, at the
command line or in a control file, if you want HACKSAW to temporarily
ignore the PROXY_IGNORE_FILE setting in your HACKSAW.INI file: Just
use "none" or "n" as the value inside the parentheses.
1. The SEND Subcommand
This subcommand is used to send one file from the local PC to the host
server. It requires the following argument (in addition to the ones
which are required for all FTP subcommands):
LOCALFILE(e:\dirname\filename.ext)
Optional arguments are:
HOSTFILE(/innoval/filename.new) if you want to specify the name the
file should receive on the host
TYPE(ascii) if you don't want your file sent in binary mode
Note that HACKSAW FTP sends and retrieves all files in binary
mode by default. This is different from most FTP tools, which
default to ascii mode. This is because the vast majority of FTP
transfers are done in binary mode, and we think that people
shouldn't have to specify the mode they use nearly all the time;
it should be the default.
"a" is a synonym for "ascii" as the value for the TYPE argument.
Also, "b" is a synonym for "binary", but the only reason to ever
use a binary TYPE argument is in a control file where your
global argument is ascii but you have an exception that needs to
be sent in binary mode. Because in any other situation, HACKSAW
assumes the TYPE(binary) argument without your specifying it.
SITECOMMAND(chmod 666) if you want HACKSAW to execute the site
command "chmod 666 [HOSTFILE]" for you after transferring the
file
Note that by default, HACKSAW will append the HOSTFILE name to
the end of the site command you specify. (If you don't specify
HOSTFILE in a SEND subcommand, HACKSAW uses the same name as the
source file, so that's what it uses as a HOSTFILE argument in
the site command as well.) If you need for the HOSTFILE name to
instead be inserted at some other point in the command, just
place the string &HF or $HF into your site command at that point.
For example, SITECOMMAND(chmod $HF 666) would tell HACKSAW to
execute "chmod [HOSTFILE] 666" after the file has been
transferred.
Example: HACKSAW FTP SEND HOST(ftp.innoval.com) USERID(innoval)
PASSWORD(secret) LOCALFILE(e:\dirname\filename.ext)
2. The SENDALL Subcommand
This subcommand is used to send all the files in a directory, or all
the files which match a wildcard specification, from the local PC to
the host server. It requires the same arguments as the SEND
subcommand, with the following exceptions:
LOCALFILE: Optional. Instead of one filename, you can specify *
which means all files (this is the default, so you don't even
have to specify it), or *.* which means all files which have an
extension, or *.EXE which means only files which have the
extension EXE, or T* which means only files which start with T,
etc.
HOSTFILE: Not used; the host files will have the same filenames
as the local files.
Optional arguments are:
SINCE(19961225172536) to tell HACKSAW to send only the files with a
time stamp of 5:25:36pm on December 25, 1996, or later. That
is, the time stamp is specified as yyyymmddhhmmss. You may
insert any number of space characters, if you like, to make that
argument more readable. For example, SINCE(1996 12 25 172536).
If you omit any amount of the end of the date string, the
program will assume the lowest possible values for the omitted
parts. For example, if you drop the minutes and seconds, the
program will assume 00:00. If you drop the day, hours, minutes,
and seconds, the program will assume 00:00:00 on the 1st of the
specified month. You can also specify TODAY (or leave the value
in parentheses blank) or YESTERDAY as the value, and the program
will translate that to 00:00:00 of the date which represents
today or yesterday.
CASE(lower) if you want the host filenames to be in lowercase
CASE(upper) if you want the host filenames to be in uppercase
CASE(drive) if you want the host filenames to be in the same case as
the local filenames
If you don't use this argument, HACKSAW will send the files with
the same filenames they have on the local drive. Using this
argument, you can specify that they should be sent in uppercase
or lowercase. The only reason to ever use "drive" as a CASE
argument is in a control file where your global argument is
upper or lower but you have an exception that needs to be sent
with the normal case treatment instead.
You can use "l", "u", or "d" instead of spelling out "lower",
"upper", or "drive".
TYPE: Exactly as used with the SEND subcommand.
SITECOMMAND: Exactly as used with the SEND subcommand.
Example: HACKSAW FTP SENDALL HOST(ftp.innoval.com) USERID(innoval)
PASSWORD(secret)
3. The SYNCHRONIZEHOST Subcommand
This subcommand is used to make the host directory match the local
one, by sending all files which exist on the local PC but not on the
host, and each file which has a later timestamp on the local PC than
the matching file on the host. It requires the same arguments as the
SEND subcommand, with the same required exceptions as the SENDALL
subcommand.
Optional arguments are:
HOST-LOCALTIMEDIFFERENCE(2:08) to tell HACKSAW that in order to
compare the time stamps of the files, it must add 2 hours and 8
minutes to the time stamps of the files on the host. You would
use this value as an argument if your FTP server were two time
zones west of you and also had a clock that was running 8
minutes slower than your PC's clock. If it were two time zones
west and running 8 minutes faster, then your argument would be
HOST-LOCALTIMEDIFFERENCE(1:52) instead. If the server were two
time zones east of you and set to the right time, the argument
would be HOST-LOCALTIMEDDIFFERENCE(-2). Or for one time zone
east, running 8 minutes fast, HOST-LOCALTIMEDIFFERENCE(-0:52).
CASE: Exactly as used with the SENDALL subcommand.
TYPE: Exactly as used with the SEND subcommand.
SITECOMMAND: Exactly as used with the SEND subcommand.
Example: HACKSAW FTP SYNCHRONIZEHOST HOST(ftp.innoval.com)
USERID(innoval) PASSWORD(secret)
4. The RETRIEVE Subcommand
This subcommand (or its popular synonym, GET) is used to download one
file from the host server to the local PC. It requires the following
arguments (in addition to the ones which are required for all FTP
subcommands):
HOSTFILE(/innoval/filename.ext)
Optional arguments are:
LOCALFILE(e:\dirname\filename.new) if you want to specify the name
the file should receive on the local drive
TYPE: Exactly as used with the SEND subcommand.
SITECOMMAND: Exactly as used with the SEND subcommand.
Example: HACKSAW FTP RETRIEVE HOST(ftp.innoval.com) USERID(innoval)
PASSWORD(secret) HOSTFILE(/innoval/filename.ext)
5. The RETRIEVEALL Subcommand
This subcommand (or its popular synonym, GETALL) is used to retrieve
all the files in a directory, or all the files which match a wildcard
specification, from the host server to the local PC. It requires the
same arguments as the RETRIEVE subcommand, with the following
exceptions:
HOSTFILE: Optional. Instead of one filename, you can specify *
which means all files (this is the default, so you don't even
have to specify it unless you're also specifying a directory
name here or in a HOSTDIRECTORY argument), or *.* which means all
files which have an extension, or *.EXE which means only files
which have the extension EXE, or T* which means only files which
start with T, etc.
LOCALFILE: Not used; the local files will have the same filenames
as the source files.
Optional arguments are:
SINCE: Exactly as used with the SENDALL subcommand.
TYPE: Exactly as used with the SEND subcommand.
SITECOMMAND: Exactly as used with the SEND subcommand.
Example: HACKSAW FTP RETRIEVEALL HOST(ftp.innoval.com)
USERID(innoval) PASSWORD(secret) HOSTFILE(/dirname/*)
6. The SYNCHRONIZELOCAL Subcommand
This subcommand is used to make the local directory match the host
one, by retrieving all files which exist on the host but not on the
local PC, and each file which has a later timestamp on the host than
the matching file on the local PC. It requires the same arguments as
the RETRIEVE subcommand, with the same required exceptions as the
RETRIEVEALL subcommand.
Optional arguments are:
HOST-LOCALTIMEDIFFERENCE: Exactly as used with the SYNCHRONIZEHOST
subcommand.
TYPE: Exactly as used with the SEND subcommand.
SITECOMMAND: Exactly as used with the SEND subcommand.
Example: HACKSAW FTP SYNCHRONIZELOCAL HOST(ftp.innoval.com)
USERID(innoval) PASSWORD(secret) HOSTFILE(/dirname/*)
7. The LIST Subcommand
This subcommand (or its popular synonym, DIR) is used to get a list of
the files on the host and some information about each of them. It
requires the following arguments (in addition to the ones which are
required for all FTP subcommands):
HOSTFILE: Usually a wildcard specification. Describes the files
whose information you want the server to show you. If you want
the information on the entire current directory, using most FTP
programs you would just not specify any file; but with HACKSAW,
leaving out the HOSTFILE specification causes HACKSAW to prompt
you for it during execution. To prevent that, you can specify .
(a single period) as the HOSTFILE. Do not use *.* for this
purpose, since it will only show you the files which have an
extension. And * will show you the current directory and all of
its subdirectories as well. So for the entire current directory
and nothing else, use . as the HOSTFILE specification.
LOCALFILE: Can be CON, to show the information on your screen; or
it can be a filename, in which the information will be stored.
If the file already exists, it will be overwritten, as would be
expected with any other FTP function.
Example: HACKSAW FTP LIST HOST(ftp.innoval.com) USERID(innoval)
PASSWORD(secret) HOSTFILE(/innoval/*.EXE)
LOCALFILE(e:\stuff\dirs.out)
8. The DELETE Subcommand
This subcommand is used to delete a file from the host. It requires
the following argument (in addition to the ones which are required for
all FTP subcommands):
HOSTFILE(/innoval/filename.ext)
Note: This argument does support wildcards, such as * for all
files or *.TXT for all files with TXT as their extension.
Example: HACKSAW FTP DELETE HOST(ftp.innoval.com) USERID(innoval)
PASSWORD(secret) HOSTFILE(/innoval/filename.ext)
9. The RENAME Subcommand
This subcommand is used to rename a file on the host. It requires the
following arguments (in addition to the ones which are required for
all FTP subcommands):
SOURCEFILE(/innoval/filename.ext)
TARGETFILE(filename.new)
Note: The reason this example will work is the fact that HACKSAW
will copy the source directory specification to the target
filename specification for you, before passing the command to the
server. So you don't have to type the directory name in both
places even though the server requires it to be in both places.
Example: HACKSAW FTP RENAME HOST(ftp.innoval.com) USERID(innoval)
PASSWORD(secret) SOURCEFILE(/innoval/filename.ext)
TARGETFILE(filename.new)
10. The SITECOMMAND Subcommand
This subcommand makes HACKSAW tell the FTP server to execute a site
command on the host computer. It requires the following arguments (in
addition to the ones which are required for all FTP subcommands):
HOSTFILE(/innoval/filename.ext)
SITECOMMAND(chmod 666) to tell the server to execute "chmod 666
[HOSTFILE]"
Notice that by default, HACKSAW appends the HOSTFILE name to the
end of the site command you specify. If you need for the
HOSTFILE name to instead be inserted at some other point in the
command, just place the string $HF or &HF into your site command
at that point. For example, SITECOMMAND(chmod $HF 666) would
tell HACKSAW to execute "chmod [HOSTFILE] 666" instead.
Example: HACKSAW FTP SITECOMMAND HOST(ftp.innoval.com)
USERID(innoval) PASSWORD(secret) SITECOMMAND(chmod 666)
HOSTFILE(/innoval/filename.ext)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
HTTP SUBCOMMANDS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
These arguments (shown with example values) are required for all HTTP
subcommands:
HOSTFILE(www.innoval.com)
LOCALFILE(index.htm) must be specified even if the filename is to be
the same as the source file on the host; the program does not
have any way of being able to tell whether the HOSTFILE you've
specified is a filename or a directory name, so it cannot assume
that whatever's after the last slash should be the filename
USERID(innoval) if the web site is password-protected
PASSWORD(secret) if the web site is password-protected
PORT(81) if your HTTP server's port number is anything other than
the default of 80; which is rare, so most people do not need
this argument; but if you have an HTTP server with a non-default
port, you'll need this argument for every HACKSAW HTTP command
you use to reach that server; Note: If you use a proxy server,
you must use a different method to specify the target server's
port number, instead of using this PORT argument: Attach it to
the server's name in the HOSTFILE argument, as in www.abc.com:81
or www.abc.com:81/dirname/pagename.htm
PROXYHOST(internet.innoval.com) if you have HTTP access through a
firewall which uses the type of classical proxy software which
wants to receive the target server name as part of the GET
method, at the beginning of what would ordinarily be the
directory name; for example GET
http://www.innoval.com:81/index.htm HTTP/1.0; or if you have a
proxy server specified in the HACKSAW.INI file and you need for
HACKSAW to temporarily ignore it, specify "none" or "n" as the
server name here, or use the HACKSAW DEFINE PROXY subcommand to
turn off proxy support for a longer period of time, or use
HACKSAW DEFINE PROXY_IGNORE_FILE to specify certain servers for
which you always want proxy support to be ignored
PROXYPORT(81) if that proxy server's HTTP port number is anything
other than the default of 80
Or you could put the arguments into a control file, and use only this
argument at the command line:
CONTROLFILE(e:\hacksaw\ctrlfile.002)
Optional arguments are:
LOCALDIRECTORY: Exactly as used with the FTP command.
Note: If the HTTP server returns an error code of 400 or above, but
also an entity body (for example, the 404 error code is always
accompanied by a small web page entitled Not Found; I'm sure you've
seen it on more than one occasion), then HACKSAW will store the entity
body in the LOCALFILE but also display a message on your screen and
return an errorlevel equal to the server's error code. The screen
message tells you that there was an error, and the entity body (as
well as the errorlevel if you happen to know the meanings of the HTTP
return codes by heart) will tell you what the server had to say about
what caused the error.
PROXYIGNOREFILE: Exactly as used with the FTP command.
1. The RETRIEVE Subcommand
This subcommand (and its popular synonym, GET) is used to retrieve one
file from the host server to the local PC.
Example: HACKSAW HTTP RETRIEVE HOSTFILE(www.innoval.com/filename.htm)
LOCALFILE(filename.htm)
2. The RETRIEVEHEADERS Subcommand
This subcommand (and its popular synonym, GETHDR) is used to retrieve
just the header lines (and one line which HACKSAW will add, called
URL-Address:, which will contain the value used in your HOSTFILE
argument) of one file from the host server to the local PC.
Example: HACKSAW HTTP RETRIEVEHEADERS HOSTFILE(www.innoval.com/)
LOCALFILE(header1.txt)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
EMAIL SUBCOMMANDS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This argument (shown with an example value) is required for all EMAIL
subcommands:
PORT(26) for SEND subcommands if your SMTP server's port number is
anything other than the default of 25 or for the other
subcommands if your POP3 server's port number is anything other
than the default of 110; which is rare, so most people do not
need this argument; but if you have a server with a non-default
port, you'll need this argument for every HACKSAW EMAIL command
you use to reach that server
Or you could put the arguments into a control file, and use only this
argument at the command line:
CONTROLFILE(e:\hacksaw\ctrlfile.003)
1. The SEND Subcommand
This subcommand is used to send an email message via an SMTP server.
It requires the following arguments (shown with example values):
HOST(mail.providername.com)
FROM(info@innoval.com)
TO(elsewhere@wherever.com)
The TO value can be a single internet email address; or it can
be multiple addresses separated by commas, as long as the value
is not more than 100 characters long; or it can be a filename.
If HACKSAW can find the file, it will use the contents of the
file as addresses, instead of using the filename as an address.
The file should be a plain ASCII text file full of email
addresses, one on each line. Or it can have multiple addresses
on each line if they're separated by commas and the maximum line
length is not more than 100 characters.
SUBJECT(This is a test)
NOTETEXT(This is a very short message!)
Of course, most often you will specify a filename instead of a
string of text as the NOTETEXT argument. If HACKSAW can find
the file you've specified, it will use the contents of the file
as the message text, instead of using the filename as the message
text.
Example: HACKSAW EMAIL SEND HOST(mail.providername.com)
FROM(info@innoval.com) TO(elsewhere@wherever.com)
SUBJECT(This is a test) NOTETEXT(e:\dirname\message.txt)
THE POP3 SERVER EMAIL SUBCOMMANDS
These arguments (shown with example values) are required for all POP3
server EMAIL subcommands:
HOST(pop.providername.com)
USERID(innoval)
PASSWORD(secret)
2. The MAILWAITING Subcommand
This subcommand is used to find out whether there's any mail waiting
for you in your POP3 account, and if so, how many messages. It does
not require any arguments other than the ones which are required for
all EMAIL POP3 server subcommands.
Note on errorlevels: When the HACKSAW command is actually EMAIL or
NOTE (case insensitive) and the subcommand is MAILWAITING or one of
its recognized synonyms, so that the program actually gets into the
MAILWAITING operation's routines, all errors will be returned with
negative errorlevels instead of the normal positive numbers. This is
so that the number of messages waiting on the POP3 server (zero or a
positive number) can be returned as an errorlevel code, so a batch
file or other program from which you're running HACKSAW will be able
to determine whether there's mail waiting or not, and act accordingly.
Example: HACKSAW EMAIL MAILWAITING HOST(pop.providername.com)
USERID(innoval) PASSWORD(secret)
3. The RETRIEVE Subcommand
This subcommand is used to retrieve email messages from a POP3
account. It requires the following argument (in addition to the ones
which are required for all EMAIL POP3 server subcommands):
LOCALFILE(e:\dirname\filename.ext) to store the messages in that
file; or you can specify CON as the "filename", to display the
messages on your screen (in which case you'll want to pipe the
output to the MORE command, or keep your finger on your PAUSE
key)
Optional arguments are:
LOCALDIRECTORY: Exactly as used with the FTP command.
MESSAGENUMBERS(1,7,9) if you want to retrieve only certain
messages; you may use spaces instead of commas if you like; the
value of this argument string cannot be longer than 300
characters; you may also specify ALL or * as the MESSAGENUMBERS
value in a control file where your global argument is a specific
message number but you have an exception line that needs to
retrieve all the waiting messages
REPLACE(y) if you want HACKSAW to overwrite the LOCALFILE if it
already exists; normally the new mail is appended to the end of
such a file; you may also specify "N" as the REPLACE value in a
control file where your global argument is "Y" but you have an
exception line whose mail you want to have appended to the
LOCALFILE
DELETE(y) if you want HACKSAW to delete each message from the POP3
server after successful retrieval; you may also specify "N" as
the DELETE value in a control file where your global argument is
"Y" but you have an exception line whose mail you want to leave
on the host server
HEADERS(y) if you want HACKSAW to store only certain header lines
(To:, From:, Date:, Subject:, Reply-to:, Priority:, Message-ID:,
and Content-Type:) and the size of the message, instead of the
entire message; you may also specify "N" as the HEADERS value in
a control file where your global argument is "Y" but you have an
exception line for which you want to get the entire message
SEPARATOR(unix/hex=##/string) to tell HACKSAW what to use as a
divider line between each message and the next in the LOCALFILE;
the value "unix" means HACKSAW will use a "From " line as in
UNIX mail files; a value of, for example, "hex=12" would make
HACKSAW use the 12h character (and a carriage return) as the
divider; any other string (200 characters or fewer in length)
besides "default" or "def" would be used literally as the
separator; you may specify "default" or "def" as the SEPARATOR
value in a control file where your global argument is one of the
others but you have an exception line for which you want HACKSAW
to use its default separator, which looks something like this:
-=-=-=-=-=-= 25-Dec-96 17:25:36 Message [1 of 3] =-=-=-=-=-=-
Note on errorlevels: When the HACKSAW command is actually EMAIL or
NOTE (case insensitive) and the subcommand is RETRIEVE or one of its
recognized synonyms, so that the program actually gets into the
EMAIL RETRIEVE operation's routines, all errors will be returned with
negative errorlevels instead of the normal positive numbers. This is
so that the number of messages retrieved can be returned as an
errorlevel code, so a batch file or other program from which you're
running HACKSAW will be able to determine whether any mail just
arrived or not, and act accordingly.
Example: HACKSAW EMAIL RETRIEVE HOST(pop.providername.com)
USERID(innoval) PASSWORD(secret)
LOCALFILE(e:\dirname\filename.ext)
4. The DELETE Subcommand
This subcommand is used to delete email messages from a POP3 account.
It requires the following argument (in addition to the ones which are
required for all EMAIL POP3 server subcommands):
MESSAGENUMBERS(2,6,7) or you may use spaces instead of commas if
you like; you may also specify ALL or * to delete them all; this
argument string cannot be longer than 300 characters
Example: HACKSAW EMAIL DELETE HOST(pop.providername.com)
USERID(innoval) PASSWORD(secret) MESSAGENUMBERS(3)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
DEFINE SUBCOMMANDS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The DEFINE command is used to add entries to your HACKSAW.INI file
(which is written to and read from in the directory in which your
HACKSAW.EXE file resides). This command does not use the same syntax
as the others; arguments do not involve parentheses, and cannot be
obtained from control files or via prompting. They can only be
specified via the command line.
To remove an entry from your HACKSAW.INI file, just specify "" (that
is, nothing, between quotation marks) as the value to be added to the
file. Instead of changing the entry's value to "nothing", it will
delete the whole entry. For example, to remove your default FTP
server setting, use this command:
HACKSAW DEFINE FTP_SERVER ""
Or if you prefer, you can use any ASCII text editor to modify the file
manually.
The OS/2 version of HACKSAW does not use the normal OS/2 method of
writing *.INI files. Instead, it uses a routine which works the same
way as Windows's normal *.INI-file-writing routine. This way, if you
use both operating systems, your OS/2 HACKSAW.INI file is
interchangeable with your Windows HACKSAW.INI file. This also means
that the HACKSAW.INI file is plain ASCII text. So you can modify it
as you like, which is quite difficult with the normal OS/2 style of
*.INI file.
1. The DEFAULT_USERID Subcommand
Example: HACKSAW DEFINE DEFAULT_USERID INNOVAL
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW FTP to do something
without telling it a userid argument to use, it would automatically
use INNOVAL as the userid without prompting you for a userid.
2. The PASSWORD Subcommand
Example: HACKSAW DEFINE PASSWORD INNOVAL SECRET
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW FTP, HTTP, or a POP3
server EMAIL subcommand to use INNOVAL as your userid without also
telling it the password to use, it would automatically use SECRET as
INNOVAL's password without prompting you for it. Of course, the
password value is encrypted before it's stored in the HACKSAW.INI
file. There is no limit to the number of userid/password pairs you
can store using this subcommand.
3. The DEFAULT_MAILUSER Subcommand
Example: HACKSAW DEFINE DEFAULT_MAILUSER innoval secret
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW EMAIL to do something
with a POP3 server without telling it a userid argument to use, it
would automatically use INNOVAL as the userid and SECRET as the
password without prompting you for those values. Of course, the
password value is encrypted before it's stored in the HACKSAW.INI
file.
4. The DEFAULT_MAILFROM Subcommand
Example: HACKSAW DEFINE DEFAULT_MAILFROM info@innoval.com
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW to send an email message
without giving it a FROM argument, it would automatically use
info@innoval.com without prompting you for a FROM address.
5. The SMTP_SERVER Subcommand
Example: HACKSAW DEFINE SMTP_SERVER mail.providername.com
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW to send an email without
giving it a HOST argument, it would automatically use
mail.providername.com without prompting you for a server address.
6. The POP3_SERVER Subcommand
Example: HACKSAW DEFINE POP3_SERVER pop.providername.com
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW to interact with a POP3
server without giving it a HOST argument, it would automatically use
pop.providername.com without prompting you for a server address.
7. The FTP_SERVER Subcommand
Example: HACKSAW DEFINE FTP_SERVER ftp.innoval.com
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW FTP to do something
without giving it a HOST argument, it would automatically use
ftp.innoval.com without prompting you for a server address.
8. The FTPPROXY_SERVER Subcommand
Example: HACKSAW DEFINE FTPPROXY_SERVER internet.innoval.com
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW FTP to do something
without giving it a PROXYHOST argument, it would automatically use
internet.innoval.com as the proxy server unless you had used the PROXY
subcommand to turn off the proxy support or unless the target server
were specified via a PROXYIGNOREFILE argument or via a DEFINE
PROXY_IGNORE_FILE subcommand.
9. The HTTPPROXY_SERVER Subcommand
Example: HACKSAW DEFINE HTTPPROXY_SERVER internet.innoval.com
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW HTTP to do something
without giving it a PROXYHOST argument, it would automatically use
internet.innoval.com as the proxy server unless you had used the PROXY
subcommand to turn off the proxy support or unless the target server
were specified via a PROXYIGNOREFILE argument or via a DEFINE
PROXY_IGNORE_FILE subcommand.
10. The FTPPROXY_PORT Subcommand
Example: HACKSAW DEFINE FTPPROXY_PORT 22
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW FTP to use a proxy server
without giving it a PROXYPORT argument, it would automatically use 22
as the proxy server's port number.
11. The HTTPPROXY_PORT Subcommand
Example: HACKSAW DEFINE HTTPPROXY_PORT 81
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you told HACKSAW HTTP to use a proxy
server without giving it a PROXYPORT argument, it would automatically
use 81 as the proxy server's port number.
12. The PROXY Subcommand
Example: HACKSAW DEFINE PROXY OFF
This sample command would add this entry to your HACKSAW.INI file so
that from then on (until you execute HACKSAW DEFINE PROXY ON), whenever
you execute an HTTP or FTP command without specifying a PROXYHOST
argument, the program will act as if you did not have a proxy server
defined even if you do; in other words, it will interact directly with
the target server instead of trying to go through the proxy server. So
this is what you want to do if you take your laptop outside the
firewall, or if you're going to work only with servers that are inside
the firewall for a while and you haven't specified their names in a
PROXY_IGNORE_FILE file.
13. The PROXY_IGNORE_FILE Subcommand
Example: HACKSAW DEFINE PROXY_IGNORE_FILE C:\HACKSAW\SERVERS.IGN
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you execute an HTTP or FTP command which
would otherwise use proxy support, the proxy support will be bypassed
if the specified file contains the name of the target server. So the
specified file is where you want to list the names of the servers
inside your firewall, and servers you never try to reach except when
you've taken your laptop outside the firewall. The file must be plain
ASCII text, one server name per line; blank lines and lines which begin
with * will be ignored.
14. The VARIABLE Subcommand
Example: HACKSAW DEFINE VARIABLE MyGifDir /company/thisdir/graphics
This sample command would add this entry to your HACKSAW.INI file so
that from then on, whenever you want to say
"/company/thisdir/graphics" in response to a HACKSAW prompt or as an
argument at the command line or in a control file, you could just type
$MyGifDir or &MyGifDir instead of typing out that whole long string.
When HACKSAW sees an argument that starts with the $ or & symbol, it
uses the rest of the string (after that symbol) as a variable name and
tries to find that variable in the HACKSAW.INI file. If it finds one,
it uses that variable's value instead of using the string that started
with the $ or & symbol.
The reason HACKSAW can use either & or $ for this purpose is that, for
example, OS/2's command interpreter uses & for its own purpose, to
allow more than one command to be typed on one command line. Other
third-party command interpreters can be used which allow the user to
specify certain symbols to be used for certain other purposes. So
HACKSAW allows you two choices, so that if your command interpreter
uses one of them for another purpose, you still have another choice
you can use for this HACKSAW function. If your command interpreter
uses both $ and & for something else, then try enclosing your
&VARIABLE or $VARIABLE in quotation marks inside the parentheses;
perhaps then your command interpreter will ignore the symbol, and let
HACKSAW see it normally.
The name HF is reserved for use with the FTP SITECOMMAND subcommand
and argument, so don't use it as a variable name.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ARGUMENTS FOR ALL COMMANDS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MESSAGEFILE(e:\dirname\msgsout.txt)
Normally, HACKSAW sends messages to the screen to tell you about
the progress or results of an action. You can send those screen
messages to a file for later review, instead of to the screen,
by using this argument. You can prevent the messages from going
anywhere by using NONE or QUIET as the "filename". You can
specify the "filename" CON, CONS, CONSOLE, or SCREEN to have the
output sent to the screen instead of to a file. But since
that's what HACKSAW normally does when you don't specify a
MESSAGEFILE argument, the only time you'd need to do that is in
a control file where you're using the MESSAGEFILE argument to
send most of the output to an output file but want just one
file's (or one TO: line's) output to go to the screen instead,
for some reason.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CONTROL FILES
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1. How to Use
There are two ways to use control files. You can specify just the
control file's name as the only HACKSAW command line argument if the
very first line of the control file contains a COMMAND argument and a
SUBCOMMAND argument. For example, if the first line of the
CTRLFILE.004 file in the current directory included:
COMMAND(FTP) SUBCOMMAND(SEND)
then you would just type
HACKSAW CTRLFILE.004
at the command line instead of having to start HACKSAW with this
command:
HACKSAW FTP SEND
When you start HACKSAW in this manner, with just a control file's name
as the first command line argument, any other arguments on the command
line will be ignored. So they must all be inside the control file
instead.
"CMD" is a valid abbreviation for COMMAND, and "SCMD" and "SUB" are
valid SUBCOMMAND abbreviations.
The other way to use a control file is to specify the command and the
subcommand on HACKSAW's command line, along with a
CONTROLFILE(e:\dirname\ctrlfile.005) argument to tell HACKSAW to find
some or all of its arguments in that file instead of on the command
line. For example:
HACKSAW FTP SEND CONTROLFILE(e:\dirname\ctrlfile.005)
In this case, the CTRLFILE.005 file should not contain COMMAND and
SUBCOMMAND arguments; and any additional valid arguments you use on
that command line will be recognized.
2. How to Build
Regardless of which way you use it, a control file must be plain ASCII
text, and can contain three types of lines. The first type, argument
lines, is optional. Any line which starts with anything other than /*,
TO:, or FILE: will be treated as an argument line. You specify the
arguments here in the exact same way you specify them at the command
line: An argument name, followed (without a space) by an argument
value in parentheses. But you cannot leave off the closing parenthesis
the way you can at the command line. You can put a separate argument
on each line, or put all your arguments on one very long line, or put
several arguments on each line but use several lines to hold them all.
These argument lines can appear at the beginning of the file, the end,
the middle, or mixed througout, with no effect whatsoever on the
results. (Except that COMMAND and SUBCOMMAND arguments will not work
unless they're on the first line of the file.)
Any argument that HACKSAW doesn't recognize as a valid argument for
the subcommand being processed, will be entirely ignored, just as at
the command line.
The second type of line in a control file is the comment line. A
comment line starts with the string /*. For example:
/* This is a comment.
Comment lines are also optional. You only need to use them if you want
to remind yourself of something, or put some information into the file
that you want HACKSAW to ignore when it reads the file. The most
common use of comment lines is when you have a control file, to which
you want to make a temporary change, which will be easy to put back
later: Just insert /* at the beginning of a line to make the program
ignore that line, and then remove the /* from it when it's time to put
the file back to its original state.
The third type of control file line is the only one that's mandatory.
It's the FILE: line where you specify the files you want to act upon
or, in the case of the EMAIL SEND subcommand, the TO: line where you
specify the addresses to which you want to send the message. The
easiest example is the latter, so let's start with that.
3. TO: Lines for EMAIL SEND Control Files
With a control file for an EMAIL SEND subcommand, the TO argument is
not used on argument lines or at the command line. Instead, any number
of TO: lines is used:
TO: elsewhere@wherever.com
TO: nobody@fakedomain.org
TO: whosit@thisplace.com
You can also specify other arguments on the TO: lines. For example,
if you wanted to use the same subject line for all the messages except
for the one that's sent to nobody@fakedomain.org, you could specify
that subject line in the SUBJECT argument in one of the argument lines
of the control file, or at the command line from which the control
file was invoked; and then use this TO: line for
nobody@fakedomain.org:
TO: nobody@fakedomain.org<TAB>SUBJECT(Other Subject Line)
In control files for the EMAIL SEND subcommand, on the TO: lines, the
addresses cannot contain any <TAB> characters, and any arguments must
be separated from the addresses by a <TAB> character. So to create
such a file, you must use an editor which can put <TAB> characters
into a file instead of converting them to spaces the way so many
editors do. Under Windows, three editors which work for this purpose
are WordPad, Notepad, and EDLIN.EXE. Under OS/2, E.EXE does; EPM does
as well, but only if you make the <TAB> characters using the Alt-009
method rather than with the <TAB> key.
Whatever arguments are used on a TO: line will override any same-named
arguments specified on the argument lines of the control file or at
the command line, for that one TO: address only. The control file's
"global" arguments will still be used for all other TO: lines, before
and after that one.
The TO: line can contain a filename instead of an email address. That
file should be a plain ASCII text file full of email addresses, one on
each line. There can be more than one address on a line if each is
separated from the others by a comma, as long as the entire line is
100 characters or fewer in length. If HACKSAW can find the specified
file, it will send the message to all the addresses in it, instead of
trying to use the filename itself as an email address.
In order to have a way around the problem that can occur when you send
too much data at once to some SMTP servers, HACKSAW logs off the
server and logs back on between each TO: line and the next. So you
can use one control file to send a very large number of messages at
once, without choking your server, as long as each TO: line's message
is small enough for the server to handle. But if you have one message
you need to send to a lot of people, and you want it done without
HACKSAW disconnecting and reconnecting and you're sure your SMTP server
can handle it, then you want to put all the addresses on one TO: line.
You can do that by having all the addresses in an ASCII text file and
specifying that file's name as your TO: address; or by putting all the
addresses on the TO: line, separated by commas, as long as they fit
within 100 characters.
4. FILE: Lines for All Other Control Files
For subcommands other than EMAIL SEND, a control file needs FILE: lines
instead of TO: lines. These are used instead of any HOSTFILE and
LOCALFILE arguments in the argument lines or at the command line.
(That is, HOSTFILE and LOCALFILE arguments are not used in control
files; the information that would go there goes on the FILE: lines
instead.) Don't ever think of these lines as being like the command
line, where in most operating system commands you type the source
filename first and then the target filename. These FILE: lines do not
work that way. In every case in which you need to specify a host
filename and a local PC filename in these FILE: lines, you must specify
the local PC filename first, then a space, then the host filename.
This means if you want to retrieve several files from the host to edit
them and then send them back to the host, you can use the same control
file, without modification, for your HACKSAW FTP RETRIEVE and SEND
subcommands.
If you have a filename with a space in it, you must surround it with
quotation marks. For example, to retrieve /innoval/filename.ext from
the host, and store it with the same filename on the local PC in this
three-word directory, use this FILE: line:
FILE: "e:\long named dir\filename.ext" /innoval/filename.ext
Just as with the TO: lines in EMAIL SEND control files, the FILE:
lines can contain other arguments which act as exceptions to the
"global" arguments. For example, if all of the files you're sending
are in the e:\senddir directory except one, you could use
LOCALDIRECTORY(e:\senddir) on an argument line or at the command line,
to act as a global argument for all the FILE: lines, but then use:
FILE: except.txt /innoval/except.txt LOCALDIRECTORY(e:\otherdir)
for that one file's FILE: line. Whatever arguments are used on a FILE:
line will override any same-named arguments specified on the argument
lines of the control file or at the command line, for that one FILE:
entry only. The control file's "global" arguments will still be used
for all other FILE: lines, before and after that one.
Exception: Once the CHANGEDIRECTORY argument has been used to issue a
CWD command to an FTP server, that's the server's current directory for
the duration of that session, unless another CWD command is issued
later. So in effect, a CHANGEDIRECTORY argument on a FILE: line of a
control file will apply to that line and all subsequent lines until
another CHANGEDIRECTORY argument is used.
Note that on FILE: lines (as opposed to the TO: lines used with EMAIL
SEND subcommands), the filenames are separated from any optional
arguments by a space character, not by a <TAB> character.
Different subcommands require different information on the FILE: lines
of their control files. Here are all of the subcommands followed by
the arguments they need on their FILE: lines.
FTP SEND
FTP RETRIEVE
FTP LIST
HTTP RETRIEVE
HTTP RETRIEVEHEADERS
FILE: LOCALFILE HOSTFILE
FTP RENAME
FILE: SOURCEFILE TARGETFILE
FTP DELETE
FTP SITECOMMAND
FILE: HOSTFILE
FTP SENDALL
FTP SYNCHRONIZEHOST
FILE: LOCALFILE HOSTDIRECTORY
FTP RETRIEVEALL
FTP SYNCHRONIZELOCAL
FILE: LOCALDIRECTORY HOSTFILE
EMAIL RETRIEVE
FILE: LOCALFILE
EMAIL MAILWAITING
EMAIL DELETE
These subcommands do not take filename arguments, so they have no
FILE: lines in control files, so there is very little reason to ever
use them with control files; unless you just happen to prefer using
a control file to using a command line via a batch file, for some
reason. In which case, it is the argument lines which are mandatory
in such control files; rather than the FILE: lines which are the
only mandatory lines in any other control files.
DEFINE (all)
This command cannot be used with control files.
At the command line, you can omit the target file specification when
you want the target file's name to be the same as that of the source
file. But in control files, you can't do that. The arguments
specified above are absolutely required on every FILE: line in a
control file. But what you can do when you want the target filename
to be the same as the source filename, other than typing it in both
places, is use an * symbol as the target filename. However, if you do
that in a control file that's to be used for an FTP SEND subcommand,
for example, then you can't use the same control file for an FTP
RETRIEVE subcommand the way you could if you specified the target
filename. Because when you use the same control file for the opposite
operation, what was the target filename specification becomes the
source specification; the former can be *, but the latter can not.
An EMAIL RETRIEVE control file can let you put each message into a
separate LOCALFILE, if you use a MESSAGENUMBERS(1) argument on one
line, a MESSAGENUMBERS(2) argument on the next, etc., and different
LOCALFILE names on each line. But if you do this for some reason, you
may notice that HACKSAW will log off the POP3 server and log back on,
between each FILE: line and the next.
The reason it does that, is so that it is possible to retrieve mail
from multiple POP3 accounts at once! You just specify different HOST,
USERID, and PASSWORD arguments on each FILE: line.
Remember, just like at the command line, any time you have a filename
which contains pathname information, you can specify it as part of the
filename specification, or you can use the HOSTDIRECTORY or
LOCALDIRECTORY argument. This is particularly useful for control
files. For example, you can have FILE: lines which say:
FILE: e:\dirname\file001.gif /innoval/subdir/graphics/file001.gif
FILE: e:\dirname\file002.gif /innoval/subdir/graphics/file002.gif
FILE: e:\dirname\file003.gif /innoval/subdir/graphics/file003.gif
Or you can use LOCALDIRECTORY(e:\dirname) and
HOSTDIRECTORY(/innoval/subdir/graphics) arguments and simpler FILE:
lines:
FILE: file001.gif file001.gif
FILE: file002.gif file002.gif
FILE: file003.gif file003.gif
Another useful example would be to synchronize the following pairs of
directories:
FILE: e:\directory\subdir1 /innoval/subdir/graphics
FILE: e:\directory\subdir2 /innoval/subdir/htmfiles
FILE: e:\directory\subdir3 /innoval/subdir/cgifiles
An FTP SYNCHRONIZEHOST control file could contain those lines, or it
could contain LOCALDIRECTORY(e:\directory) and
HOSTDIRECTORY(/innoval/subdir) arguments and these FILE: lines instead:
FILE: subdir1 graphics
FILE: subdir2 htmfiles
FILE: subdir3 cgifiles
Even though they're really directory names instead of files, all
HACKSAW is going to do is prepend the DIRECTORY arguments to them
(with a slash or backslash, as appropriate) before using them, so this
will work as desired.
5. Example Control Files
COMMAND(FTP) SUBCOMMAND(SEND) HOST(ftp.innoval.com)
USERID(innoval) PASSWORD(secret)
FILE: e:\dirname\filename.ext /innoval/filename.ext
FILE: e:\otherdir\other.fil /innoval/filename.002
This control file will execute an FTP SEND subcommand to send two
files. Since it has COMMAND and SUBCOMMAND arguments in it, it needs
to be used via a HACKSAW command line with just the control file's name
(not even the CONTROLFILE label with it) as the only command line
argument.
HOST(ftp.innoval.com) USERID(innoval) PASSWORD(secret)
FILE: e:\dirname\filename.ext /innoval/filename.ext TYPE(b)
FILE: e:\otherdir\other.fil /innoval/filename.002
Since this control file does not have COMMAND and SUBCOMMAND arguments
on its first line, it needs to be executed via a command line such as:
HACKSAW FTP SEND CONTROLFILE(e:\hacksaw\ctrlfile.006) TYPE(a)
This control file could be used for both FTP SEND and FTP RETRIEVE.
The first file will be transferred in the binary mode, regardless of
the global TYPE argument used, if any. Because its FILE: line has its
own TYPE(b) argument. But the second FILE: line has no TYPE argument,
so it will be transferred in whatever mode is in effect globally in the
control file. By default, that would be binary. But with the example
command line shown here, it would be ascii. Or if there were a
TYPE(ascii) argument inside the control file on an argument line or on
the second FILE: line, the second file would go in ascii mode then, as
well, even if TYPE(a) were not specified on the command line.
HOST(mail.providername.com) FROM(info@innoval.com)
TO: innoval@ibm.net<TAB>NOTETEXT(Please give me a call asap.)
SUBJECT(This is a test) NOTETEXT(e:\dirname\message.txt)
TO: prmbeta@ibm.net
TO: postsvc@ibm.net<TAB>SUBJECT(Second test)
This control file would be used with a HACKSAW EMAIL SEND subcommand.
The prmbeta address will receieve the MESSAGE.TXT message with a
subject line of "This is a test". The postsvc address will receive the
same message but with its own subject line. And the innoval address's
message will have the global subject line, "This is a test", but its
message text will be just that short sentence, "Please give me a call
asap." Note that the fact that the second argument line is between one
TO: line and the next instead of being before the first one has no
meaning at all. The program reads all the argument lines at the same
time, before it starts working on any of the TO: lines. The same is
true of the FILE: lines in other subcommands' control files, as well.
HOST(pop.providername.com) HEADERS(y)
FILE: e:\dirname\mailfile.in USERID(innoval) REPLACE(y)
FILE: e:\dirname\mailfile.in USERID(postsvc) HEADERS(n)
FILE: e:\dirname\mailfile.in USERID(prmbeta) SEPARATOR(PRMBeta Msg)
This control file would be used with a HACKSAW EMAIL RETRIEVE
subcommand. It would log onto the POP3 server as the innoval account
and retrieve certain header lines of all the messages there, and store
them in the MAILFILE.IN file, overwriting that file if it already
existed. Then it would log onto the server as postsvc, and retrieve
all those messages. Since there's no REPLACE(y) argument on that line
and the default behavior of the EMAIL RETRIEVE subcommand is to append
to the LOCALFILE file when it already exists, the messages will be
added to the end of the same file that was used for the innoval
messages. Furthermore, since that line has a HEADERS(n) argument, the
entire message will be stored instead of only the headers, even though
there's a HEADERS(y) argument in effect globally. Next, HACKSAW will
log onto the server as prmbeta, retrieve the headers, and append them
to the end of the same file, this time using "PRMBeta Msg" as the
separator line instead of the default separator, before each of the
messages it places into the file.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
ERRORLEVELS
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
For each type of error that HACKSAW can encounter, it returns a
different errorlevel code that can be read by a batch file, REXX
program, or other type of program from which you might run HACKSAW.
Following is the list of errorlevels and their meanings. Remember, the
EMAIL RETRIEVE and MAILWAITING subcommands return these codes as
negative errorlevels rather than positive ones.
0 No errors found
2 User pressed ESC key while HACKSAW was prompting for required
arguments
5 Required arguments were not supplied
10 The first command line argument was not a control file, nor FTP,
HTTP, EMAIL, or DEFINE; or the second command line argument was
not a valid subcommand for the specified command
15 Invalid time stamp found during FTP SENDALL or FTP GETALL
20 Could not read control file
21 Error allocating memory for a thread
30 Error trying to write a DEFINE entry to the HACKSAW.INI file
50 Could not connect to host server
70 Error issuing USER command to FTP server
71 Error issuing PASS command to FTP server
72 Timeout during FTP operation
73 Error issuing TYPE command to FTP server
74 Error issuing PORT command to FTP server
75 Error issuing STOR command to FTP server
76 Error creating data socket for FTP SEND or RETRIEVE command
77 Error opening LOCALFILE during FTP SEND or FTP/EMAIL RETR command
78 Could not find LOCALFILE during FTP SEND command
79 Error creating listen socket for FTP SEND or RETRIEVE command
80 Error issuing RETR command to FTP server
81 Error issuing SITE command to FTP server
82 Error issuing DELE command to FTP server
83 Error issuing RNFR command to FTP server
84 Error issuing RNTO command to FTP server
85 Error issuing CWD command to FTP server
90 No matching files were found during FTP SENDALL
91 No matching files were found during FTP GETALL
94 No matching files were found during FTP SYNCHRONIZEHOST
95 No matching files were found during FTP SYNCHRONIZELOCAL
110 Timeout during HTTP operation
111 Error opening LOCALFILE during HTTP operation
150 Error issuing MAIL FROM command to SMTP server
151 Error issuing RCPT TO command to SMTP server
152 Error issuing DATA command to SMTP server
153 Error sending final (.) line to SMTP server
180 Error issuing USER command to POP3 server
181 Error issuing PASS command to POP3 server
182 Timeout during POP3 operation
190 Error issuing STAT command to POP3 server
191 Error issuing TOP command to POP3 server
192 Error issuing RETR command to POP3 server
193 Error issuing DELE command to POP3 server
200 Attempt to EMAIL RETRIEVE or EMAIL DELETE while no messages exist
201 Error writing LOCALFILE during EMAIL RETRIEVE
Any higher errorlevel number is what comes from the HTTP server if
there's an error during an HTTP command.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Support
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
If you need help with this product or have suggestions, please email us
at hacksaw@innoval.com, fax us at 914.835.3857, or visit our web page
at http://www.innoval.com.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Acknowledgments
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hacksaw is packaged using INFO-ZIP's compression utility. INFO-ZIP's
software (ZIP, UNZIP, and related utilities) is free and can be
obtained as source code or executables from various bulletin board
services and anonymous FTP sites, including CompuServe's IBMPRO forum
and ftp.uu.net/pub/archiving/zip/*.
IBM and OS/2 are registered trademarks of the IBM Corporation.
Microsoft and Windows are registered trademarks of the Microsoft
Corporation. All other brands, both cited and not cited, are
trademarks, registered trademarks, or service marks of their respective
companies.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SYNTAX SCREEN
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Here is the syntax screen which HACKSAW displays if you execute it
with no command line arguments or with ? as its argument. Please note
the abbreviations (synonyms) listed to the right of each
command/subcommand/argument that has them. You may use any
command/subcommand/argument interchangeably with any of its synonyms
at any time. Most of the arguments can be used with all of the
subcommands in the group under which they appear. A few arguments,
though, apply only to one or two subcommands. These arguments have
those specific subcommands displayed to their left in lowercase
letters.
Syntax: HACKSAW <command> <subcommand> <arg1>...<argN> Synonyms:
Arguments for all commands: MESSAGEFILE(filename) MESSAGES MSGS MF
Commands: FTP <ftp subcommand> <arg1>...<argN>
FTP subcommands: SEND PUT
SENDALL PUTALL
SYNCHRONIZEHOST SYNCHOST SYNCH
RETRIEVE RETR GET
RETRIEVEALL RETRALL GETALL
SYNCHRONIZELOCAL SYNCLOCAL SYNCL
LIST DIR
DELETE ERASE DELE DEL
RENAME REN RE
SITECOMMAND SITECMD SITE SC
FTP arguments: USERID(userid) USER U
PASSWORD(password) PASS PW
HOST(host)
PORT(number) [Default: 21]
TYPE(BINARY/ascii) MODE
HOSTFILE(host filename) HFILE HF
SOURCEFILE SFILE SF
LOCALFILE(local filename) LFILE LF
PCFILE PFILE PF
TARGETFILE TFILE TF
HOSTDIRECTORY(host directory) HOSTDIR HDIR HD
LOCALDIRECTORY(local directory) LOCALDIR LDIR LD
CHANGEDIRECTORY(host directory) CHDIR CD
sendall/synchost: CASE(DRIVE/upper/lower) CS
sendall/retrall: SINCE(yyyymmddhhmmss) ASOF
synchost/synclocal: HOST-LOCALTIMEDIFFERENCE(hh:mm) TIMEDIF HLTD TD
SITECOMMAND(site command) SITECMD SITE SC
PROXYHOST(server) PHOST PH
PROXYPORT(number) [Default: 21] PPORT PP
PROXYIGNOREFILE(filename) IGNOREFILE PIFILE
CONTROLFILE(control filename) CFILE CF
HTTP <http subcommand> <arg1>...<argN> WEB
HTTP subcommands: RETRIEVE RETR GET
RETRIEVEHEADERS RETRHEAD GETHDR
HTTP arguments: USERID(userid) USER U
PASSWORD(password) PASS PW
PORT(number) [Default: 80]
HOSTFILE(host filename) HFILE HF
SOURCEFILE SFILE SF
LOCALFILE(local filename) LFILE LF
PCFILE PFILE PF
TARGETFILE TFILE TF
LOCALDIRECTORY(local directory) LOCALDIR LDIR LD
PROXYHOST(server) PHOST PH
PROXYPORT(number) [Default: 80] PPORT PP
PROXYIGNOREFILE(filename) IGNOREFILE PIFILE
CONTROLFILE(control filename) CFILE CF
EMAIL <email subcommand> <arg1>...<argN> NOTE
EMAIL subcommands: SEND
MAILWAITING MAILWAIT MWAIT MW
RETRIEVE RETR GET
DELETE ERASE DELE DEL
EMAIL arguments: PORT(number) [Default: SMTP 25/POP3 110]
HOST(host) SMTPSERVER SMTP SS
send: FROM(address) F
send: TO(address/filename) T
send: SUBJECT(subject string) SUBJ SUB
send: NOTETEXT(text/filename) TEXT BODY
retrieve/mwait/del: USERID(userid) USER U
retrieve/mwait/del: PASSWORD(password) PASS PW
retrieve: LOCALFILE(local filename) LFILE LF
PCFILE PFILE PF
TARGETFILE TFILE TF
retrieve: LOCALDIRECTORY(local directory) LOCALDIR LDIR LD
retrieve: SEPARATOR(DEF,unix,hex=##,string) DIVIDER SEP DIV
retrieve: HEADERS(y/N) HDR
retrieve: DELETE(y/N) ERASE DELE DEL
retrieve: REPLACE(y/N) REPL REP RE
retrieve/delete: MESSAGENUMBERS(msgX,msgY,...msgZ) MSGNUMS MN
NOTENUMBERS NOTES NN
CONTROLFILE(control filename) CFILE CF
DEFINE <define subcommand> <arg1>...<argN> STORE INI DEF
DEFINE subcommands: DEFAULT_USERID userid DEF_USER DEFUSER DU
PASSWORD userid password PW
DEFAULT_MAILUSER address password DEF_MAIL MAILUSER DMU
DEFAULT_MAILFROM address DEF_FROM FROM DF
SMTP_SERVER server SERVER SMTP SS
POP3_SERVER server POP3SERVER POP3 PS
FTP_SERVER server FTPSERVER FTP FS
FTPPROXY_SERVER server FPS
HTTPPROXY_SERVER server HPS
FTPPROXY_PORT number FPP
HTTPPROXY_PORT number HPP
PROXY_IGNORE_FILE filename IGNORE_FILE PIFILE
PROXY on/off
VARIABLE variable value VAR