If you are using Object REXX (the DEVCON 8/9 edition), the "=" command will be disabled, as well as "external" commands. The first point is due to a definition change in the STREAM() built-in function, and will be fixed in a future release of Less, but the second point is due to a bug in the LINEIN('CON:') built-in function, and will not be fixed by Less.
Less is a file browser. When used as a MORE.EXE replacement, it provides much faster displays, the ability to run any program/command and some information (the elapsed number of lines, mainly).
When used as a command, it provides horizontal and vertical scrolling, the ability to locate a text string, to jump to a specified line... and it can cycles through more than one file.
And less.cmd is small (less than 2Kb). But if you are new to REXX, this command file is not necessarily the best place to start with, though :-) [It is nicely indented - to my taste - but there is not that much comments, and it includes some cryptic statements...]
Installing Less is very simple: just copy LESS.CMD somewhere along your PATH.
Syntax
less filename [filename ...] ... | less less <...
Examples
less *.doc *.txt dir | less less <config.sys
[A "*" following a command name denotes a command which cannot be used when less.cmd is called as a filter.]
nnn Move to line number nnn. +nnn Move forward (down) nnn number of lines. -nnn Move backward (up) nnn number of lines.
Example
<D:\backup\config.new line=1 col=1 pos=1142/3905 file=1/4>
The search is case-insensitive.
Example
/REM
The top-line will be positioned on the first occurrence of "REM" in the current file. If nothing is found, you will get a new less ":" prompt, as in:
:/azert :_
/
The top-line will be positioned on the next occurrence of the previously defined searchstring (REM in our example).
If no next occurrence exists, you will get a new less ":" prompt, as in:
:/ :_
Warning: When calling a REXX script, you have to precede its name with "call ".
The following internal variables may be of interest:
A the command line arguments file the current file name r the screen height c the screen width l the current top-line number d the current horizontal delta n the current file position in the ring m the number of file in the ring t.i (where i is in 1..m) the ith file name s the current search string
Examples
To display the current directory, enter
dir
[If you want to use jokers chars, you will have to use single or double quotes, as in: dir "*.cmd".]
To display the current search string, enter
say s
To edit the currently displayed file with tedit, enter
call exc close; tedit file
and use the "." command to redraw the screen.
[Well, the "call exc close" is not very, er, intuitive, but it is required in order to prevent a file-sharing violation -- that is, less is currently reading the file, and so, nobody can change it. Automatically closing the file may be implemented in a future release, though...]