1SZ(1)                       General Commands Manual                      SZ(1)
2
3
4

NAME

6       sx, sb, sz - XMODEM, YMODEM, ZMODEM file send
7

SYNOPSIS

9       sz [-+8abdefkLlNnopqTtuvyY] file ...
10       sb [-adfkqtuv] file ...
11       sx [-akqtuv] file
12       sz [-oqtv] -c COMMAND
13       sz [-oqtv] -i COMMAND
14       sz -TT
15

DESCRIPTION

17       Sz  uses the ZMODEM, YMODEM or XMODEM error correcting protocol to send
18       one or more files over a dial-in serial port to a variety  of  programs
19       running under PC-DOS, CP/M, Unix, VMS, and other operating systems.
20
21       While  rz is smart enough to be called from cu(1), very few versions of
22       cu(1) are smart enough to allow sz to work properly.  Unix  flavors  of
23       Professional-YAM are available for such dial-out application.
24
25
26       Sz sends one or more files with ZMODEM protocol.
27
28       ZMODEM  greatly simplifies file transfers compared to XMODEM.  In addi‐
29       tion to a friendly user interface, ZMODEM  provides  Personal  Computer
30       and  other  users  an  efficient,  accurate,  and  robust file transfer
31       method.
32
33       ZMODEM provides complete END-TO-END data integrity between  application
34       programs.   ZMODEM's 32 bit CRC catches errors that sneak into even the
35       most advanced networks.
36
37       Advanced file management features include AutoDownload (Automatic  file
38       Download  initiated  without  user intervention), Display of individual
39       and total file lengths and transmission time estimates, Crash Recovery,
40       selective  file  transfers,  and  preservation  of  exact file date and
41       length.
42
43       Output from another program may be piped  to  sz  for  transmission  by
44       denoting standard input with "-":
45                                    ls -l | sz -
46       The  program  output is transmitted with the filename sPID.sz where PID
47       is the process ID of the sz program.  If the environment variable ONAME
48       is set, that is used instead.  In this case, the Unix command:
49                             ls -l | ONAME=con sz -ay -
50       will  send  a  "file"  to  the  PC-DOS  console display.  The -y option
51       instructs the receiver to open the file  for  writing  unconditionally.
52       The  -a  option  causes the receiver to convert Unix newlines to PC-DOS
53       carriage returns and linefeeds.
54
55
56       Sb batch sends one or more files with YMODEM or ZMODEM  protocol.   The
57       initial  ZMODEM  initialization  is  not  sent.   When requested by the
58       receiver, sb supports YMODEM-g with "cbreak" tty  mode,  XON/XOFF  flow
59       control,  and  interrupt  character set to CAN (^X).  YMODEM-g (Profes‐
60       sional-YAM g option) increases  throughput  over  error  free  channels
61       (direct  connection, X.PC, etc.)  by not acknowledging each transmitted
62       sector.
63
64       On Unix systems, additional information about the file is  transmitted.
65       If  the  receiving  program uses this information, the transmitted file
66       length controls the  exact  number  of  bytes  written  to  the  output
67       dataset, and the modify time and file mode are set accordingly.
68
69
70       Sx  sends  a  single  file with XMODEM or XMODEM-1k protocol (sometimes
71       incorrectly called "ymodem").  The user must supply the  file  name  to
72       both sending and receiving programs.
73
74       If  sz  is  invoked  with $SHELL set and iff that variable contains the
75       string  rsh  ,  rbash  or  rksh  (restricted  shell),  sz  operates  in
76       restricted  mode.   Restricted  mode restricts pathnames to the current
77       directory and PUBDIR (usually /usr/spool/uucppublic) and/or subdirecto‐
78       ries thereof.
79
80
81       The  fourth form sends a single COMMAND to a ZMODEM receiver for execu‐
82       tion.  Sz exits with the COMMAND return  value.   If  COMMAND  includes
83       spaces or characters special to the shell, it must be quoted.
84
85
86       The  fifth  form sends a single COMMAND to a ZMODEM receiver for execu‐
87       tion.  Sz exits as soon as the receiver has correctly received the com‐
88       mand, before it is executed.
89
90
91       The sixth form (sz -TT) attempts to output all 256 code combinations to
92       the terminal.  In you are having difficulty sending files, this command
93       lets  you  see  which  character codes are being eaten by the operating
94       system.
95
96
97       If sz is invoked with stdout and stderr to different datasets,  Verbose
98       is  set  to 2, causing frame by frame progress reports to stderr.  This
99       may be disabled with the q option.
100
101       The meanings of the available options are:
102
103       -+, --append
104              Instruct the receiver to append transmitted data to an  existing
105              file (ZMODEM only).
106       -2, --twostop
107              use two stop bits (if possible). Do not use this unless you know
108              what you are doing.
109       -8, --try-8k
110              Try to go up to 8KB blocksize. This is incompatible  with  stan‐
111              dard  zmodem,  but  a common extension in the bbs world. (ZMODEM
112              only).
113       --start-8k
114              Start with 8KB blocksize. Like --try-8k.
115       -a, --ascii
116              Convert NL characters in the transmitted file to CR/LF.  This is
117              done  by  the  sender for XMODEM and YMODEM, by the receiver for
118              ZMODEM.
119       -b, --binary
120              (ZMODEM) Binary override: transfer file without any translation.
121       -B NUMBER, --bufsize NUMBER
122              Use a readbuffer of  NUMBER  bytes.  Default  ist  16384,  which
123              should be enough for most situations. If you have a slow machine
124              or a bad disk interface or suffer from other  hardware  problems
125              you  might  want  to  increase the buffersize.  -1 or auto use a
126              buffer large enough to buffer the whole file.  Be  careful  with
127              this  option  -  things  normally  get worse, not better, if the
128              machine starts to swap.
129
130              Using this option turns of memory mapping  of  the  input  file.
131              This increases memory and cpu usage.
132       -c COMMAND, --command COMMAND
133              Send  COMMAND  to  the  receiver for execution, return with COM‐
134              MAND´s exit status.
135       -C N, --command-tries N
136              Retry to send command N times (default: 11).
137       -d, --dot-to-slash
138              Change all instances of "." to "/" in the transmitted  pathname.
139              Thus,  C.omenB0000  (which  is unacceptable to MSDOS or CP/M) is
140              transmitted as C/omenB0000.  If the resultant filename has  more
141              than  8  characters  in  the  stem, a "." is inserted to allow a
142              total of eleven.
143
144              This option enables the --full-path option.
145       --delay-startup N
146              Wait N seconds before doing anything.
147       -e, --escape
148              Escape all control characters; normally XON, XOFF, DLE, CR-@-CR,
149              and Ctrl-X are escaped.
150       Force the sender to rename the new file if a file with the same
151              name already exists.
152       -f, --full-path
153              Send  Full  pathname.   Normally directory prefixes are stripped
154              from the transmitted filename.
155
156              This is also turned on with to --dot-to-slash option.
157       -h, --help
158              give help.
159       -i COMMAND, --immediate-command COMMAND
160              Send COMMAND to the receiver for execution,  return  immediately
161              upon the receiving program's successful recption of the command.
162       -k, --1k
163              (XMODEM/YMODEM)  Send  files  using 1024 byte blocks rather than
164              the default 128 byte  blocks.   1024  byte  packets  speed  file
165              transfers  at  high bit rates.  (ZMODEM streams the data for the
166              best possible throughput.)
167       -L N, --packetlen N
168              Use ZMODEM sub-packets of length N.  A larger  N  (32  <=  N  <=
169              1024) gives slightly higher throughput, a smaller N speeds error
170              recovery.  The default is 128 below  300  baud,  256  above  300
171              baud, or 1024 above 2400 baud.
172       -m N, --min-bps N
173              Stop  transmission  if BPS-Rate (Bytes Per Second) falls below N
174              for a certain time (see --min-bps-time option).
175       -M N, --min-bps-time
176              Used together with --min-bps. Default is 120 (seconds).
177       -l N, --framelen N
178              Wait for the receiver to acknowledge correct data every N (32 <=
179              N  <= 1024) characters.  This may be used to avoid network over‐
180              run when XOFF flow control is lacking.
181       -n, --newer
182              (ZMODEM) Send each file if  destination  file  does  not  exist.
183              Overwrite destination file if source file is newer than the des‐
184              tination file.
185       -N, --newer-or-longer
186              (ZMODEM) Send each file if  destination  file  does  not  exist.
187              Overwrite  destination  file  if  source file is newer or longer
188              than the destination file.
189       -o, --16-bit-crc
190              (ZMODEM) Disable automatic selection of 32 bit CRC.
191       -O, --disable-timeouts
192              Disable read timeout handling. This makes lsz hang if the  other
193              side doesn't send anything, but increases performance (not much)
194              and decreases system load (reduces number  of  system  calls  by
195              about 50 percent).
196
197              Use this option with care.
198       -p, --protect
199              (ZMODEM) Protect existing destination files by skipping transfer
200              if the destination file exists.
201       -q, --quiet
202              Quiet suppresses verbosity.
203       -R, --restricted
204              Restricted mode: restricts pathnames to  the  current  directory
205              and PUBDIR (usually /usr/spool/uucppublic) and/or subdirectories
206              thereof.
207       -r, --resume
208              (ZMODEM) Resume interrupted file transfer.  If the  source  file
209              is  longer  than the destination file, the transfer commences at
210              the offset in the source file that equals the length of the des‐
211              tination file.
212       -s HH:MM, --stop-at HH:MM
213              Stop  transmission  at  HH  hours,  MM minutes. Another variant,
214              using +N instead of HH:MM, stops transmission in N seconds.
215       -S, --timesync
216              enable timesync protocol support. See timesync.doc  for  further
217              information.
218
219              This  option  is  incompatible with standard zmodem. Use it with
220              care.
221       --syslog[=off]
222              turn syslogging on or off. the default is set at configure time.
223              This option is ignored if no syslog support is compiled in.
224       -t TIM, --timeout TIM
225              Change timeout to TIM tenths of seconds.
226       -T, --turbo
227              Do  not  escape  certain characters (^P, ^P|0x80, telenet escape
228              sequence [CR + @]). This improves performance by about 1 percent
229              and shouldn't hurt in the normal case (but be careful - ^P might
230              be useful if connected through a terminal server).
231       --tcp  Try to initiate a TCP/IP connection. lsz will ask the  receiving
232              zmodem  to  open  a  TCP/IP  connection.  All handshaking (which
233              address / port to use) will be done by the zmodem programs.
234
235              You will normally not want to use this option as  lrzsz  is  the
236              only  zmodem  which  understands what to do (private extension).
237              You might want to use this option if the two programs  are  con‐
238              nected  (stdin/out)  over a slow or bad (not 8bit clean) network
239              connection.
240
241              Use of this option imposes a security risk, somebody else  could
242              connect to the port in between. See SECURITY for details.
243       --tcp-client ADDRESS:PORT
244              Act as a tcp/ip client: Connect to the given port.
245
246              See --tcp-server for more information.
247
248       --tcp-server
249              Act  as  a server: Open a socket, print out what to do, wait for
250              connection.
251
252              You will normally not want to use this option as  lrzsz  is  the
253              only  zmodem  which  understands what to do (private extension).
254              You might want to use this if you have to use zmodem (for  which
255              reason  whatever),  and cannot use the --tcp option of lsz (per‐
256              haps because your telnet doesn't allow to spawn a local  program
257              with stdin/stdout connected to the remote side).
258
259              If  you  use  this  option you have to start lsz with the --tcp-
260              client ADDRESS:PORT option.  lrz will print the address and port
261              on startup.
262
263              Use  of this option imposes a security risk, somebody else could
264              connect to the port in between. See SECURITY for details.
265
266       -u     Unlink the file after successful transmission.
267       -U, --unrestrict
268              Turn off restricted mode (this is not possible if running  under
269              a restricted shell).
270       -w N, --windowsize N
271              Limit the transmit window size to N bytes (ZMODEM).
272       -v, --verbose
273              Verbose output to stderr. More v's generate more output.
274       -X, --xmodem
275              use XMODEM protocol.
276       -y, --overwrite
277              Instruct  a  ZMODEM  receiving program to overwrite any existing
278              file with the same name.
279       -Y, --overwrite-or-skip
280              Instruct a ZMODEM receiving program to  overwrite  any  existing
281              file  with  the  same name, and to skip any source files that do
282              have a file with the same pathname on the destination system.
283       --ymodem
284              use ZMODEM protocol.
285       -Z, --zmodem
286              use ZMODEM protocol.
287

SECURITY

289       Restricted mode restricts pathnames to the current directory and PUBDIR
290       (usually /var/spool/uucppublic) and/or subdirectories thereof, and dis‐
291       ables remote command execution.
292
293       Restricted mode is entered if the R option is given or if  lsz  detects
294       that  it  runs  under a restricted shell or if the environment variable
295       ZMODEM_RESTRICTED is found.
296
297       Restricted mode can be turned of with the U option if not running under
298       a restricted shell.
299
300
301       Use of the
302              --tcp-client or --tcp-server options imposes a security risk, as
303              somebody else could connect to the port before you  do  it,  and
304              grab  your data. If there's strong demand for a more secure mode
305              i might introduce some sort of password challenge.
306
307
308

ENVIRONMENT

310       ZNULLS may be used to specify the number of  nulls  to  send  before  a
311              ZDATA frame.
312
313       SHELL  lsz  recognizes a restricted shell if this variable includes rsh
314              or rksh
315
316       ZMODEM_RESTRICTED
317              lrz enters restricted mode if the variable is set.
318
319       TMPDIR If this environment variable is set its content is used  as  the
320              directory  to  place  in  the answer file to a timesync request.
321              TMP Used instead of TMPDIR if TMPDIR  is  not  set.  If  neither
322              TMPDIR nor TMP is set /tmp will be used.
323

EXAMPLES

325       ZMODEM File Transfer (Unix to DSZ/ZCOMM/Professional-YAM)
326       % sz -a *.c
327       This  single  command transfers all .c files in the current Unix direc‐
328       tory with conversion (-a) to end of line conventions appropriate to the
329       receiving environment.  With ZMODEM AutoDownload enabled, Professional-
330       YAM  and ZCOMM will automatically recieve the files after performing  a
331       security check.
332
333       % sz -Yan *.c *.h
334       Send only the .c and .h files that exist on both systems, and are newer
335       on the sending system than the corresponding version on  the  receiving
336       system, converting Unix to DOS text format.
337       $ sz -\Yan file1.c file2.c file3.c foo.h baz.h ®(for VMS)
338
339       ZMODEM Command Download (Unix to Professional-YAM)
340        cpszall:all
341           sz -c "c:;cd /yam/dist"
342           sz -ya $(YD)/*.me
343           sz -yqb y*.exe
344           sz -c "cd /yam"
345           sz -i "!insms"
346       This Makefile fragment uses sz to issue commands to Professional-YAM to
347       change current disk and directory.  Next, sz transfers  the  .me  files
348       from  the  $YD  directory, commanding the receiver to overwrite the old
349       files and to convert from Unix end of line conventions to  PC-DOS  con‐
350       ventions.   The  third  line transfers some .exe files.  The fourth and
351       fifth lines command Pro-YAM to change directory and  execute  a  PC-DOS
352       batch  file  insms .  Since the batch file takes considerable time, the
353       -i form is used to allow sz to exit immediately.
354
355       XMODEM File Transfer (Unix to Crosstalk)
356       % sx -a foo.c
357       ESC
358       rx foo.c
359       The above three commands transfer a single file from Unix to a  PC  and
360       Crosstalk  with sz translating Unix newlines to DOS CR/LF.  This combi‐
361       nation is much slower and far less reliable than ZMODEM.
362

ERROR MESSAGES

364       "Caught signal 99" indicates the program  was  not  properly  compiled,
365       refer to "bibi(99)" in rbsb.c for details.
366

SEE ALSO

368       rz(omen),    ZMODEM.DOC,   YMODEM.DOC,   Professional-YAM,   crc(omen),
369       sq(omen), todos(omen), tocpm(omen), tomac(omen), yam(omen)
370
371       Compile  time  options  required  for  various  operating  systems  are
372       described in the source file.
373

VMS VERSION

375       The VMS version does not support wild cards.  Because of VMS DCL, upper
376       case option letters muse be represented by \ proceding the letter.
377
378       The current VMS version does not support XMODEM, XMODEM-1k, or YMODEM.
379
380       VMS C Standard I/O and RMS may interact to modify the file contents.
381

FILES

383       32 bit CRC code courtesy Gary S. Brown.
384
385       sz.c, crctab.c, rbsb.c, zm.c, zmodem.h Unix source files
386
387       sz.c, crctab.c,  vrzsz.c,  zm.c,  zmodem.h,  vmodem.h,  vvmodem.c,  VMS
388       source files.
389
390       /tmp/szlog stores debugging output (sz -vv) (szlog on VMS).
391

TESTING FEATURE

393       The  command "sz -T file" exercises the Attn sequence error recovery by
394       commanding errors with unterminated  packets.   The  receiving  program
395       should  complain  five  times about binary data packets being too long.
396       Each time sz is interrupted, it should send a ZDATA header followed  by
397       another  defective  packet.   If the receiver does not detect five long
398       data packets, the Attn sequence is not interrupting the sender, and the
399       Myattn string in sz.c must be modified.
400
401       After 5 packets, sz stops the "transfer" and prints the total number of
402       characters "sent" (Tcount).  The difference  between  Tcount  and  5120
403       represents  the number of characters stored in various buffers when the
404       Attn sequence is generated.
405

BUGS

407       Calling sz from most  versions  of  cu(1)  doesn't  work  because  cu's
408       receive process fights sz for characters from the modem.
409
410       On  at least one BSD system, sz would hang or exit when it got within a
411       few kilobytes of the end of file.  Using the "-w 8192" flag  fixed  the
412       problem.   The  real  cause is unknown, perhaps a bug in the kernel TTY
413       output routines.
414
415       Programs that do not properly implement  the  specified  file  transfer
416       protocol  may  cause  sz  to "hang" the port for a minute or two.  This
417       problem is corrected by using ZCOMM, Pro-YAM, or other program  with  a
418       correct implementation of the specified protocol.
419
420       Many  programs  claiming  to support YMODEM only support XMODEM with 1k
421       blocks, and they often don't get that quite right.
422
423       XMODEM transfers add up to 127 garbage bytes per file.   XMODEM-1k  and
424       YMODEM-1k transfers use 128 byte blocks to avoid extra padding.
425
426       YMODEM programs use the file length transmitted at the beginning of the
427       transfer to prune the file to the correct length; this may cause  prob‐
428       lems  with  source  files  that grow during the course of the transfer.
429       This problem does not pertain to ZMODEM transfers, which  preserve  the
430       exact file length unconditionally.
431
432       Most ZMODEM options are merely passed to the receiving program; some do
433       not implement all these options.
434
435       Circular buffering and a ZMODEM sliding  window  should  be  used  when
436       input  is  from  pipes instead of acknowledging frames each 1024 bytes.
437       If no files can be opened, sz sends a ZMODEM command to echo a suitable
438       complaint;  perhaps  it  should  check for the presence of at least one
439       accessible file before getting hot and bothered.  The test mode  leaves
440       a zero length file on the receiving system.
441
442       A  few high speed modems have a firmware bug that drops characters when
443       the direction of high speed transmissson is reversed.  The  environment
444       variable  ZNULLS  may  be  used  to specify the number of nulls to send
445       before a ZDATA frame.  Values of 101 for a 4.77 mHz PC and 124  for  an
446       AT are typical.
447
448
449
450lrzsz-0.12b                        2.6.1996                              SZ(1)
Impressum