The part of this program that does the actual search for files is specific to OS/2, but the rest should be fairly generic.
This program isn`t terribly millennium compliant, but that`s due to the fact that OS/2 Rexx function used to search for the files (SysFileTree) only returns the last two years of the file`s date.
type afile.txt | drop 10will output all but the first 10 lines of
afile.txt
to the
standard output. Thus nothing would be output if afile.txt
contained fewer than 10 lines.
This program is based on the CMS Pipelines stage of the same name, though it doesn`t support the FIRST and LAST options. Also see the take.cmd program below.
As an example,
locate 1.2 -/*- < rexxfile.cmdwill output those lines of
rexxfile.cmd
that start
with the Rexx opening comment symbol (/*).
This program is based on the CMS Pipelines stage of the same name, though it doesn`t support multiple column ranges or empty search strings. Also see the nlocate.cmd program below.
As an example,
nlocate 1.2 -/*- < rexxfile.cmdwill output those lines of
rexxfile.cmd
that do not start
with the Rexx opening comment symbol (/*).
This program is based on the CMS Pipelines stage of the same name, though it doesn`t support multiple column ranges or empty search strings. Also see the locate.cmd program above.
rexx do i = 1 to 10; say random(1, 6); endwill print out ten random numbers each between 1 and 6 inclusive.
This is basically just a very simple version of the REXXTRY program that comes with most Rexx distributions.
Though it comes configured to back up C and C++ files, it can be
modified to copy other types of files just by changing the
copyPatterns
string, which contains the file patterns of
the files to back up.
The command that does the actual copying is specific to DOS/Win/OS/2, but there should be an equivalent command on just about every other platform.
type afile.txt | take 5will output the first 5 lines of
afile.txt
to the
standard output. If afile.txt
has 5 lines or fewer then
the entire file would be output.
This program is based on the CMS Pipelines stage of the same name, though it doesn`t support the FIRST and LAST options. Also see the drop.cmd program above.