|SUD - Small Utilities for Dos|
|SUD is a collection of Dos programs that I've created for my personal use (SUD stands for Small Utilities for Dos). This collection includes programs to: search for a hexadecimal sequence; replace sequences of bytes with other sequences; extend or truncate files; merge sorted files; change video mode and blink status; show the pathname of a command in the path; set environment variables according to mouse position.|
Utilities for Dos/Windows; freeware/GNU General Public License 2.0.
1.0 / english.
This collection of programs include a few utilities that I've created for my personal use in the last year; they can be used to:
|BLANKIT||invoke a screen blanker; the user must press a button on the mouse or a key on the keyboard to exit (mouse movements are ignored)|
|BLINK||toggle between blink mode/hi-intensity mode|
|FHEX||locate hexadecimal sequences in a file, with wildcards|
|MERGE||merge two sorted files|
|MOUSE||set environment according to mouse position|
|PAD||extend or truncate files|
|TRANS||replace sequences of bytes with other sequences|
|VMODE||change text video mode interactively (25/43/50 lines)|
|WHICH||print pathname of a command in the path|
All the programs, except MOUSE, print out a short usage summary if run without parameters.
BLANKIT [/B] [/M] [/Q]
this program blank screen until the user presses any key on the mouse or on the keyboard; in the meanwhile, colorful serpents run all over the screen. This is a text-only screen saver; it's not a TSR, it is useful when you leave your machine turned on and want to save your monitor's life. Unlike other screen savers, which exit when you move your mouse a little, BLANKIT ask the user to press a key to return.
/B black screen instead of bi-color serpents
/M slow mouse reset
/Q start immediately, no request
BLINK [+ | -]
BLINK + activate text blinking
BLINK - activate background intensity
This small program is useful since many programs change blink state and don't restore previous state when returning; BLINK can be used, then, to adjust things.
FHEX [/Rx] file hex_sequence
this utility finds all the occurrences of a hex sequence in a file. Each character in hex_sequence consists of two hexadecimal digits; '??' stands for any character and '**' for any group of characters (up to 5, or the number specified with /R). To specify a literal character 'c' in hex_sequence, use '=c'.
An invalid hex character is substituted with '??' before starting the search. For each match, the sequence and its absolute offset are reported.
MERGE main_file update_file destination [start] [end]
MERGE replace lines in 'main_file' with corresponding lines in 'update_file' and add the new lines found; the result is stored to 'destination'.
Lines are compared only from column 'start' to column 'end', if specified.
Important: the files 'main_file' and 'update_file' must be already sorted on the same field; reading is stopped when the character CTRL-Z is read or end-of-file is reached.
MERGE works only on Dos/Windows text files.
this utility wait for the user to press a mouse button and return setting environment variables:
YR to screen row (starting from 0)
XC to screen columnn (starting from 0)
If variables are not present in environment, they are added. If any parameter is passed to the program, a clock is displayed in the top right corner of the screen during selection and is removed before exiting.
PAD filename [size | +num | -num] [padchar]
truncate or extend specified files; bytes appended are set to padchar (default = 0), which must be an integer between 0 and 255. 'filename' can include multiple wildcards '*' and '?'.
Program behaviour is as follow:
- if 'size' is specified, file length is set to size bytes;
- if '+num' is used, num bytes are added at the end of each file;
- if '-num' is used, last num bytes are deleted from each file.
All modifications are done 'in place', i.e. specified files are overwritten.
TRANS source seq2find seq2repl [/R] [/Ddest] [/K] [/Sn] [/X] [/Q]
this program replace each occurrence of seq2find in source with seq2repl. Sequences can include C-like constants; the following escape sequences are supported:
\a \b \f \n \r \t \v \\ \? \' \"
and octal, hexadecimal and decimal constants thus specified:
- \... where ... are 1 to 3 octal digits (0-7)
- \x... where ... are 1 to 3 hexadecimal digits (0-9, a-f, A-F)
- \d... where ... are 1 to 3 decimal digits (0-9)
'source' can include multiple wildcards '*' and '?'; destination files will have the same name as source files with extension ".NEW" (if /K is not specified).
TRANS can be used, for example, to convert between different text file formats:
e.g. converting Dos <-> Unix
- Dos to Unix: TRANS file \x0d\x0a \x0a
- Unix to Dos: TRANS file \x0a \x0d\x0a
/R ignore seq2repl (which must be specified, anyway) and forces removal of every occurrence of seq2find;
/D specify destination directory for newly created files (default: source directory);
/K keep original names (to be used together /D);
/Sn skip n-th substitution;
/X replace only sequences specified with /Sn;
/Q quiet operation.
this program let you change interactively the current text video mode; supported video modes are:
WHICH filename[.com | .exe | .bat]
this utility print the pathname of a command in the path; it can be useful when you have multiple instances of a program with the same filename, and you want to see which copy would be executed according to path order.
Download SUD (version 1.0 for Dos/Windows)
|Top of page|