3 The new array design will fail under msdos if you put more than
4 16K items into an array and then walk it with for(i in A).
5 Unfortunately things will probably fail ungracefully. The new
6 array design runs into 64K limits at 16K elements in an array and
7 there are no checks in the code. This is fixable, but tedious and
8 1.2.2 works well on DOS.
10 If this is a problem use version 1.2.2.
12 You can get updated source and executables (1.2.2) for DOS from
13 ftp.wustl.edu ~/systems/msdos/gnuish/mawk122[sx].zip
18 I no longer have a dos machine so must count on others to verify that
19 things work under msdos.
21 1.2 has been ported to TCC, but not MSC (I wouldn't expect this to
24 You now have to compile large model. Code will no longer fit in
25 64K and code ptr and data ptrs must be both fit in a void* hence
28 Installation instructions are in file INSTALL.
33 Three changes specific to DOS.
35 (1) Internal conversions from doubles to strings that are integers
36 use internal conversion to long so DOS and unix now give the same
43 (2) Large model uses 8K as opposed to 4K I/O buffers.
45 (3) MAWKSHELL is no longer required. If not set in the
46 environment, MAWKSHELL defaults to %COMSPEC% /c, e.g., if
51 then this has the effect of setting MAWKSHELL to
53 c:\system\command.com /c
55 Comspec should give a full drive-path specification.
58 Notes for MsDOS (mawk 1.1)
61 command.com doesn't understand ' so if you use command.com as your
62 shell (the norm under DOS) then on the command line (and NOT from
63 files) the meanings of " and ' are reversed.
65 mawk "{ print 'hello world' }"
67 If this seems too weird, use
70 { print "hello world" }
73 If you use a DOS shell that gives you a Unix style command line, to use
74 it you'll need to provide a C function reargv() that retrieves argc and
75 argv[] from your shell.
77 To enable system and pipes you need to tell mawk about your shell by
78 setting the environment variable MAWKSHELL. E.g, with command.com
80 set MAWKSHELL=c:\sys\command.com /c
82 or with a unix like shell
84 set MAWKSHELL=c:\bin\sh.exe -c
86 in your autoexec.bat. The full path with drive and extension and
87 appropriate switch is required. (Small model is a tight squeeze
88 and there's not enought room for PATH searching code.)
90 If you want to use a ram disk for the pipes, set MAWKTMPDIR.
94 The trailing backslash is required. You have to set MAWKSHELL,
95 MAWKTMPDIR is optional -- defaulting to the current directory.
98 For compatibility with Unix, CR are silently stripped from input and LF
99 silently become CRLF on output. Also ^Z indicates EOF on input (
100 evidently for compatibility with CPM!!!).
102 CR control can be turned off, with a new variable BINMODE.
103 BINMODE defaults to 0.
105 BINMODE = 1 gives binary input.
106 BINMODE = 2 gives binary output.
107 BINMODE = 3 gives both.
109 Setting BINMODE with -v or in the BEGIN section affects all
110 files, otherwise it only affects files opened after the
111 assignment to BINMODE. Once a file is open, later assignment to
112 BINMODE does not affect it. Note that with binary output, printf
113 will behave strangely -- you'll need to explicitly use \r
115 Eg mawk -v BINMODE=2 '{ printf "%d %s\r\n", NR, $0}'
117 Assignment to BINMODE does not change RS or ORS; however there is
120 -W BINMODE=1 is the same as
121 -v BINMODE=1 -v RS="\r\n" or BEGIN{BINMODE=1 ; RS = "\r\n" }
123 -W BINMODE=2 is the same as
124 -v BINMODE=2 -v ORS="\r\n" or BEGIN{BINMODE=2 ; ORS = "\r\n" }
126 -W BINMODE=3 is the same as
127 -v BINMODE=3 -v RS=ORS="\r\n" or BEGIN{BINMODE=2 ; RS=ORS = "\r\n" }
130 Setting MAWKBINMODE in the environment is the same as using -W,
131 except its permanent.
132 If you rarely have to deal with text files that contain ^Z,
133 then setting MAWKBINMODE=1 in the environment would speed up input
137 ----------------------------------------------------------
138 WARNING: If you write an infinite loop that does not print to the
139 screen, then you will have to reboot. For example
142 while( x < 10 ) A[x] = x
145 By mistake the x++ is outside the loop. What you need to do is type
146 control break and the keyboard hardware will generate an interrupt and
147 the operating system will service that interrupt and terminate your
148 program, but unfortunately MsDOS does not have such a feature.