SZ(1) DG/UX R4.11MU05 SZ(1)
NAME
sz - ZMODEM file send
SYNOPSIS
sz [-+1abdefkLlNnopqTtuvyY] file ...
sz [-1oqtv] -c COMMAND
sz [-1oqtv] -i COMMAND
DESCRIPTION
sz uses the ZMODEM error correcting protocol to send one or more
files over a serial port to a variety of programs running under PC-
DOS, CP/M, Unix, VMS, and other operating systems.
sz on DG/UX does not support the YMODEM or XMODEM protocols.
The first form of sz sends one or more files with ZMODEM protocol.
In addition to a friendly user interface, ZMODEM provides Personal
Computer and other users an efficient, accurate, and robust file
transfer method.
ZMODEM provides complete END-TO-END data integrity between
application programs. ZMODEM's 32 bit CRC catches errors that sneak
into even the most advanced networks.
Advanced file management features include AutoDownload (Automatic
file Download initiated without user intervention), Crash Recovery,
selective file transfers, and preservation of exact file date and
length.
Output from another program may be piped to sz for transmission by
denoting standard input with "-":
ps -ef | sz -
The program output is transmitted with the filename sPID.sz where PID
is the process ID of the sz program. If the environment variable
ONAME is set, that is used instead. In this case, the Unix command:
ONAME=con ps -ef|sz -ay -
will send a "file" to the PC-DOS console display. The -y option
instructs the receiver to open the file for writing unconditionally.
The -a option causes the receiver to convert Unix newlines to PC-DOS
carriage returns and linefeeds.
Iff sz is invoked with $SHELL set and iff that variable contains the
string rsh or rksh (restricted shell), sz operates in restricted
mode. Restricted mode restricts pathnames to the current directory
and PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
thereof.
The second form sends a single COMMAND to a ZMODEM receiver for
execution. sz exits with the COMMAND return value. If COMMAND
includes spaces or characters special to the shell, it must be
quoted.
The third form sends a single COMMAND to a ZMODEM receiver for
execution. sz exits as soon as the receiver has correctly received
the command, before it is executed.
If sz is invoked with stdout and stderr to different datasets,
Verbose is set to 2, causing frame by frame progress reports to
stderr. This may be disabled with the q option.
The meanings of the available options are:
+ Instruct the receiver to append transmitted data to an
existing file.
1 Use file descriptor 1 for ioctls and reads. By default, file
descriptor 0 is used. This option allows sz to be used with
the Professional-YAM $ command.
a Convert NL characters in the transmitted file to CR/LF. This
is done by the receiver for ZMODEM.
b (ZMODEM) Binary override: transfer file without any
translation.
c COMMAND
Send COMMAND to the receiver for execution, return with
COMMAND´s exit status.
d Change all instances of "." to "/" in the transmitted
pathname. Thus, C.omenB0000 (which is unacceptable to MSDOS
or CP/M) is transmitted as C/omenB0000. If the resultant
filename has more than 8 characters in the stem, a "." is
inserted to allow a total of eleven.
e Escape all control characters; normally XON, XOFF, DLE,
CR-@-CR, and Ctrl-X are escaped.
f Send Full pathname. Normally directory prefixes are stripped
from the transmitted filename.
i COMMAND
Send COMMAND to the receiver for execution, return Immediately
upon the receiving program's successful recption of the
command.
L N Use ZMODEM sub-packets of length N. A larger N (32 <= N <=
1024) gives slightly higher throughput, a smaller N speeds
error recovery. The default is 128 below 300 baud, 256 above
300 baud, or 1024 above 2400 baud.
l N Wait for the receiver to acknowledge correct data every N (32
<= N <= 1024) characters. This may be used to avoid network
overrun when XOFF flow control is lacking.
n (ZMODEM) Send each file if destination file does not exist.
Overwrite destination file if source file is newer than the
destination file.
N (ZMODEM) Send each file if destination file does not exist.
Overwrite destination file if source file is newer or longer
than the destination file.
o (ZMODEM) Disable automatic selection of 32 bit CRC.
p (ZMODEM) Protect existing destination files by skipping
transfer if the destination file exists.
q Quiet suppresses verbosity.
r (ZMODEM) Resume interrupted file transfer. If the source file
is longer than the destination file, the transfer commences at
the offset in the source file that equals the length of the
destination file.
t tim Change timeout to tim tenths of seconds.
u Unlink the file after successful transmission.
v Verbose causes a list of file names to be appended to
/tmp/szlog . More v's generate more output.
y Instruct a ZMODEM receiving program to overwrite any existing
file with the same name.
Y Instruct a ZMODEM receiving program to overwrite any existing
file with the same name, and to skip any source files that do
have a file with the same pathname on the destination system.
EXAMPLES
ZMODEM File Transfer
$ sz -a *.c
This single command transfers all .c files in the current Unix
directory with conversion (-a) to end of line conventions appropriate
to the receiving environment. With ZMODEM AutoDownload enabled,
Professional-YAM and ZCOMM will automatically recieve the files
after performing a security check.
$ sz -Yan *.c *.h
Send only the .c and .h files that exist on both systems, and are
newer on the sending system than the corresponding version on the
receiving system, converting Unix to DOS text format.
ZMODEM Command Download
cpszall:all
sz -c "c:;cd /yam/dist"
sz -ya $(YD)/*.me
sz -yqb y*.exe
sz -c "cd /yam"
sz -i "!insms"
This Makefile fragment uses sz to issue commands to Professional-YAM
to change current disk and directory. Next, sz transfers the .me
files from the $YD directory, commanding the receiver to overwrite
the old files and to convert from Unix end of line conventions to PC-
DOS conventions. The third line transfers some .exe files. The
fourth and fifth lines command Pro-YAM to change directory and
execute a PC-DOS batch file insms . Since the batch file takes
considerable time, the -i form is used to allow sz to exit
immediately.
FILES
32 bit CRC code courtesy Gary S. Brown.
sz.c, zm.c, zmodem.h source files
/tmp/szlog stores debugging output (sz -vv)
TESTING FEATURE
The command "sz -T file" exercises the Attn sequence error recovery
by commanding errors with unterminated packets. The receiving
program should complain five times about binary data packets being
too long. Each time sz is interrupted, it should send a ZDATA header
followed by another defective packet. If the receiver does not
detect five long data packets, the Attn sequence is not interrupting
the sender, and the Myattn string in sz.c must be modified.
After 5 packets, sz stops the "transfer" and prints the total number
of characters "sent" (Tcount). The difference between Tcount and
5120 represents the number of characters stored in various buffers
when the Attn sequence is generated.
BUGS
Calling sz from most versions of cu(1) doesn't work because cu's
receive process fights sz for characters from the modem.
Most ZMODEM options are merely passed to the receiving program; some
do not implement all these options.
Circular buffering and a ZMODEM sliding window should be used when
input is from pipes instead of acknowledging frames each 1024 bytes.
If no files can be opened, sz sends a ZMODEM command to echo a
suitable complaint; perhaps it should check for the presence of at
least one accessible file before getting hot and bothered. The test
mode leaves a zero length file on the receiving system.
Some high speed modems have a firmware bug that drops characters when
the direction of high speed transmissson is reversed. The
environment variable ZNULLS may be used to specify the number of
nulls to send before a ZDATA frame. Values of 101 for a 4.77 mHz PC
and 124 for an AT are typical.
Licensed material--property of copyright holder(s)