Dec 312017
 
A nice set of UNIX like commands for DOS. file 3 of 3.
File PICNIX33.ZIP from The Programmer’s Corner in
Category Utilities for DOS and Windows Machines
A nice set of UNIX like commands for DOS. file 3 of 3.
File Name File Size Zip Size Zip Type
CAT.COM 12630 7622 deflated
CP.COM 12328 7353 deflated
CPDIR.COM 11652 7003 deflated
MV.COM 14018 8214 deflated
MVDIR.COM 12256 7320 deflated
PICNIX.DOC 30732 8875 deflated
TEE.COM 11430 7025 deflated

Download File PICNIX33.ZIP Here

Contents of the PICNIX.DOC file




The PiCnix Package (PC Version):
--------------------------------

This document describes the PC Version of the PiCnix* package by
Peter Stephen Heitman. The utilities in the PiCnix package emulate
the functionality of UNIX* System V commands as completely as possible
for MS-DOS* and PC-DOS* users. The utilities included in the PiCnix
package are:


Name: cat - file listing utility
Usage: cat [ -usx? ] [ -v [-t] [-e] ] file1 ...
Version: 3.7 for PCs with DOS 2.1 and higher

Name: chlabel - set the volume label
Usage: chlabel { "" [drive specifier] } | -?
Version: 3.4 for PCs with DOS 2.1 and higher

Name: chmod - update attribute bits of files
Usage: chmod file1 ...
Version: 3.4 for PCs with DOS 2.1 and higher

Name: cp - copy files
Usage: cp file1 file2
cp file1 ... fileN directory
Version: 3.6 for PCs with DOS 2.1 and higher

Name: cpdir - copy a directory
Usage: cpdir Dir1 Dir2
Version: 3.5 for PCs with DOS 2.1 and higher

Name: df - print disk free space information
Usage: df [ -a | drive_1 [ drive_2 ... ] | -? ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: diff - find differences between two text files
Usage: diff [ -ebh? ] oldfile newfile
Version: 3.4 for PCs with DOS 2.1 and higher

Name: du - disk usage utility
Usage: du [ -ars? ] [ names ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: fgrep - fast text search through files
Usage: fgrep [ -mvclxins? ] file1 ...
Version: 3.4 for PCs with DOS 2.1 and higher

Name: grep - regular expression search through files
Usage: grep [ -mvclins? ] file1 ...
Version: 3.4 for PCs with DOS 2.1 and higher

Name: head - beginning of file listing utility
Usage: head [-count] [ file1 ... ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: ls - directory listing utility
Usage: ls [ -cx1lmetsurpfaRd? ] [ file1 ... ]
Version: 3.5 for PCs with DOS 2.1 and higher

Name: more - file listing utility
Usage: more [-cdflsd?] [+] [+/] [ file1 ... ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: mv - move files
Usage: mv [-f?] file1 file2
mv [-f?] file1 ... fileN directory
Version: 3.5 for PCs with DOS 2.1 and higher

Name: mvdir - move a directory
Usage: mvdir Dir1 Dir2
Version: 3.5 for PCs with DOS 2.1 and higher

Name: ncd - change to directory
Usage: ncd [ - | new-directory | -? ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: ndate - set and display current date and time
Usage: ndate [-?] [ mmddhhmm[yy] ] [+]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: necho - echo arguments
Usage: necho [-?]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: nset - set and display the command processor's environment
Usage: nset [-?] [ =[] ]
Version: 3.4 for PCs with DOS 2.1 and higher


Name: unset - delete a string from the command processor's environment
Usage: unset [-?]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: ntime - time a command
Usage: ntime [-?]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: pwd - print the working directory
Usage: pwd [ -a | drive_1 [ drive_2 ] ... ] | -? ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: rm - remove files
Usage: rm [ -ifr? ] file ...
Version: 3.5 for PCs with DOS 2.1 and higher

Name: show - find a file along a path
Usage: show [ -a? ] [ -p ] file1 ...
Version: 3.4 for PCs with DOS 2.1 and higher

Name: strings - print ASCII strings embedded in binary files
Usage: strings [ -? ] [ -t ] [ -n ] [ file1 ... ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: switchar - set or display the current system switch character
Usage: switchar [ | '' | "" ]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: tail - end of file listing utility
Usage: tail [ -? | {+|-} [] [l|c] ] [file]
Version: 3.4 for PCs with DOS 2.1 and higher

Name: tee - create multiple outputs from the input
Usage: tee [ -a? ] file ...
Version: 3.5 for PCs with DOS 2.1 and higher

Name: touch - update last-write times of files
Usage: touch [ -c? ] [ mmddhhmm[yy] ] file1 ...
Version: 3.4 for PCs with DOS 2.1 and higher

Name: wc - word counter
Usage: wc [ -lwc? ] [ file1 ... ]
Version: 3.5 for PCs with DOS 2.1 and higher


* PiCnix is a trademark of Peter Stephen Heitman
* UNIX is a trademark of Bell Laboratories.
* MS-DOS is a U.S. registered trademark of Microsoft, Incorporated.
* PC-DOS is a trademark of International Business Machines.



CONDITIONS FOR USE AND DISTRIBUTION:
-----------------------------------

PiCnix is being distributed under the user-distributed concept.
Please pass this package on to others and upload it to your favorite
computer bulletin board, but please make sure you give them the
complete PiCnix package, including this document. You also may not
misrepresent, either by commission or omission, the conditions
under which this program is being distributed.

If you use any of the utilities in this package on a regular
basis, it is requested that you register as a user of PiCnix by
sending a donation of $15 to the author. A registration form is
provided below for your convenience. Your donation will help
support improvements and additions to the PiCnix package. Your
registration will entitle you to receiving notices when updates are
available and will allow you to order the updated versions of the
package for only $10 per update. When you register, please include
your name and address so that notices of updates may be sent to you.

If you are registered as a user of the PiCnix package, the source
for all of these utilities, including the sources for the
underlying libraries, is available for an additional fee. The
source currently consists of over half a megabyte of 'C' source
code compatible with TURBO-C by Borland International. One library of
particular interest will be the code that provides for command line
argument expansion that is consistent with the argument expansion
provided by Unix. The only restrictions on the use of this source
code is that you may not create a competing product and a copyright
notice is required when using some of the included libraries. No
warranty is given that these sources will be suitable for any
particular purpose.


Of course, anyone may send in bug reports and suggestions for how
the package may be improved. Please try to describe the bug as
completely and accurately as possible along with a description of how
it may be reproduced consistently (if you know). I am very interested
in making the PiCnix package completely bug free, so please help me by
reporting any bugs you encounter. Suggestions for how the package may
be improved are always welcome, particularly suggestions about which
System V commands to implement next.


Date: ____________________





PiCnix Package
Peter Stephen Heitman
23 Burwell Road
West Roxbury, MA 02132




Version of the PiCnix package: PC Version

Release Date of this package: May 1, 1988





Registration Fee: ($15.00) _________

Ordering the most recent update: ($10.00) _________

Ordering the sources: ($30.00) _________

Total: _________


NOTE: You must be currently registered as a user or
must include your $15.00 registration fee with
your order to be able to order an update or the
sources.



Select ONE: 360K Floppies ______ 1.2M Floppies ______




YOUR NAME: ________________________________________________

YOUR ADDRESS: ________________________________________________

________________________________________________

____________


IMPORTANT THINGS TO KNOW BEFORE USING PiCnix:
---------------------------------------------


All the utilities in the PiCnix package share a common command
line format, in general the command line for each will look like the
following.

COMMAND argument1 .... argumentN

The possible arguments are described more fully in the following
sections.


Arguments:


Options:

The Options are also referred to as switches and are used to
modify the action or purpose of a COMMAND. All the options
for a COMMAND are grouped before the first filespec. Options
are distinguished from filespecs by the very first character
called a switch character. The switch character is user
definable but will be a '/' whenever the computer is first
turned on.

You may want to use a minus sign '-' for the switch character
to be consistent with the switch character assumed by Unix.
There are two ways to change the switch character used by the
PiCnix Utilities. First, each of the PiCnix Utilities looks
for the environment variable PICNIX_SWITCHAR. If it exists, the
first character of its value is used as the switch character.
You can set the environment variable by including the
following command in your AUTOEXEC.BAT file or issuing the
command at the DOS prompt:

set PICNIX_SWITCHAR=-

The second method of changing the switch character is to
change the switch character that DOS uses. I have supplied a
utility called SWITCHAR that will allow you to show what the
current system switch character is and to set the system
switch character to a new value. NOTE: not all programs look
to see what switch character is used by DOS. This causes
some programs to fail to execute properly when the system
switch character has been changed. If you experience problems
with software after changing the system switch character, you
may want to use the first method mentioned above. It will
not interfere with the operation of any other software. To
set the switch character you can include the following
command in your AUTOEXEC.BAT file or issuing the command at
the DOS prompt:

switchar -

The switch character that you select will also determine the
meaning of other characters on the command line. If you use
the default switch character of '/', the following will be
used:

On input, the single-escape will be a pound sign '#'.
On output, the directory separator will be a back-slash
'\'. and filenames by default will be printed in UPPER
CASE.

If you use a switch character different than the default '/',
the following will be used:

On input, the single-escape will be a back-slash '\'.
On output, the directory separator will be a slash '/'.
and filenames by default will be printed in lower
case.

The single-escape character is explained below.

The way that filenames are printed can be changed by setting
the environment variable PICNIX_FNCASE. If the value of the
environment variable is 'down', filenames will be printed in
lower case. If the value of the environment variable is
'up', filenames will be printed in UPPER CASE.

You can set the environment variable by including the
following command in your AUTOEXEC.BAT file or issuing the
command at the DOS prompt:

set PICNIX_FNCASE=down

switch character:

If the switch character is at the beginning of an argument,
that argument is assumed to be an option. Files should not
be created that begin with the switch character as this makes
them very difficult to work with. It is not even possible to
remove them with the rm command!


single-escape:

The single-escape causes the next character to not be treated
specially. For example, a space or a tab normally separates
one argument from another. By using the single-escape, it is
possible to make one argument out of two words. If the
single escape is a back slash '\', the following is one
argument:

one\ argument

The utility would see the argument as being a string of 12
characters "one argument", including the space. This is
particularly useful for the utilities fgrep and grep, which
search for a string in a list of files. The single escape
also causes the special characters single quote ', double
quote '"', dollar sign '$', star '*', question mark '?', left
bracket '[' and single-escape to not be special if the
single-escape appears immediately before the special character.

NOTE: The single escape is removed from the argument unless
the argument is enclosed in single quotes. In order
to get a single-escape in the argument, use two of
them. The first single-escape causes the second one
to not be treated specially.



dollar sign '$':

The dollar sign signals the beginning of an environment
variable. The characters beginning right after the dollar
sign and continuing until the first character that is not a
digit or a letter is assumed to be an environment variable.
If that sequence of characters IS an environment variable,
the value of the environment variable is inserted in its
place on the command line. For example, assume that the
command line argument is: $lib/myfile. If at the DOS prompt
you had previously entered the command:

SET LIB=/source


$lib/myfile would be interpreted as /source/myfile. If $lib
was not defined (did not exist in the current environment),
the utility would see that argument as /myfile. The $lib
would be ignored completely.

Environment variables are defined using the DOS command SET,
or the PiCnix command NSET, and are active until deleted or
the system is re-started. Please see the section in your DOS
manual about the SET command for additional information.

Many of the utilities in the PiCnix package use environment
variables to set or change default options.


single quote ':

The single quote is used to make one argument out of a string
of words. For example:

'this is one argument'

NOTE: Everything inside of a single quoted string is passed
to the application as is. No expansion of environment
variables or wildcard characters are done.


double quote '"':

The double quote is like the single quote except that the
single-escape and the dollar sign (described below) ARE
expanded.


Filespecs:

File specifiers are made from 3 parts,

Wildcard characters * ?

Environment variables $variable

Character classes [abf...]

For example:

necho $user\*
uses the value of the environment variable "user"
as the path

necho *a*
operates on file names that contain at least 1 'a'.

necho *.[qrzg]
expands to match any file with a 1 character
extension that is either q,r,z or g

necho test?.*
will match all file names that have 5 characters in
the name before the extension and the first 4
characters are "test"

These characters enable you to specify patterns that can
match 0, 1, or many filenames. If more than one filename is
matched, all of the filenames that matched become arguments
to the utility. For example, since a star '*' all by itself
matches all filenames in the current directory, the command

more * is the same as more ...


Let's assume that the following files are in the current
directory:

C1.A C1.B B1.A B1.B MYFILE BLAH

star '*':

The star '*' matches 0 or more characters in a filename,
including the dot '.'. The argument * would be expanded
into all of the filenames in the current directory. The
argument B* would expand into 3 filenames, B1.A B1.B and
BLAH. The argument *1.A would expand into 2 filenames,
C1.A and B1.A. The argument C*1.A would expand into one
filename, C1.A.


question mark '?':

The question mark '?' matches any one character,
including the dot '.'. For example, the argument C1.?
would expand into the filenames C1.A and C1.B. However,
the argument C1?.A would not match any of the filenames
in the current directory and so would not be expanded.


left and right brackets '[' and ']':

The left and right brackets [] are used to construct
character classes. Character classes are matched
against any ONE (1) character, in the same manner as the
question mark '?'. The left bracket '[' begins the
character class and the right bracket ']' ends the
character class. A character class contains a list of
the characters that are allowed to match. For example,
the argument C1.[ABC] contains a character class that
has three characters, A, B and C. This argument would
be expanded into two filenames, C1.A and C1.B .

Character classes can also contain ranges of characters.
For example, the pattern C1.[ABC] is equivalent to the
pattern C1.[A-C]. Finally, if the first character in a
character class is an exclamation point '!', the
character class matches any character that is NOT
specified between the brackets. Thus, the argument
[!B]1.A would expand into the filename C1.A.

NOTE: as a special case, patterns that end in a dot '.' will
not match any filenames that have extensions. For
example, the pattern *. will match all filenames in
the current directory that do not have an extension.


Getting help for each utility:

Each utility in the PiCnix package will display a brief
summary of what it does and what each of the command line
options are if you execute it with the argument character>?. For example, if your switch character is the
default '/', you can find out what the utility 'more' does by
executing the following line at the DOS prompt:

more /?

NOTE: In the description for each utility, command line
options are shown with the switch character being a
minus sign '-'. You need to substitute the switch
character you are using if it is not the minus sign.



History Log for PiCnix releases:

Changes Since Second Dated Release:

cat.com
cp.com
cpdir.com
mv.com
mvdir.com
tee.com
each of these utilities have been changed to correctly recognize
when the destination disk is full.

Second Dated Release: November 1, 1987
Updated: May 25, 1988

Included in this release:

cat.com chlabel.com chmod.com cp.com cpdir.com
df.exe diff.exe du.exe fgrep.com grep.exe head.com
ls.exe more.exe mv.com mvdir.com ncd.com ndate.com
necho.com nset.com ntime.com unset.com pwd.com rm.com
show.com strings.com switchar.com tail.com tee.com
touch.com wc.com

New in this release:

head.com tail.com

Modified in this release:

All of the utilities have had the following changed:
1) All utilities now look for the environment variables
PICNIX_SWITCHAR and PICNIX_FNCASE. These environment
variables can be used to specify the switch character
and the case for printing filenames, respectively.
2) The accent grave processing in the command line has
been removed. It turned out that adding this feature
added around 6K bytes to most of the utilities. It
did not seem worth it. The capability has been left
in the sources for those who purchase them. Let me
know if you don't like this change. I may put back
accent grave processing at a later date.
3) if a drive specifier is provided to a filespec, a slash
character is no longer inserted after the ':' if one is
not already there. DOS users seemed to find this
objectionable. See the notice in the first dated release
below for a description of what this did. Now, specifying
a drive with a relative path name is resolved relative to
the drive's current directory.
4) Many of the utilities have been changed to allow boolean
command line switches (i.e., switches that changed the
action from TRUE to FALSE or vice-versa ) to be set more
than once in the command line. For example, if the
command touch -c -c newfile is executed, the first
-c says to not allow touch to create files that did not
previously exist. The second -c says to undo the previous
-c and allow touch to create files. The primary use for
this would be to undo the default values set in the
environment variable for a utility. For example, if I
had set the environment variable nset TOUCH = -c and
then wanted to create a file with touch, I can now execute
the command touch -c newfile and get the expected
result.
5) Files that have the 'system' mode bit set are not
automatically hidden anymore. If a file is 'system' but
not 'hidden', it will show up with ls and the other utilities.
6) Utilities that always expanded tabs to spaces only do so now
when tabs have been defined to something other than 8 spaces.
7) If the switchar was '/' and a single-character filename
existed at root (i.e., '\'), then using the option /? would
result in strange error messages rather than printing help.
This is now fixed.

cat.com : fixed so that if it is not in visible mode (-v) and tabs are
not expanded, cat now does read()'s and write()'s instead of
fgets()'s and fputs()'s. This fixes the problem of trying to
cat binary files that contain tabs and bytes equal to 0. Also
added the -x switch to tell cat explicitly to expand tabs to
spaces. It used to be the only way cat worked.

diff.exe : fixed the output to correspond to Unix's output more closely.
Modified to now work with files with up to 2500 lines rather
than with up to 2400 lines. Changed to the Compact memory
model. Used to use a custom psuedo-virtual memory manager.
Execution is now more dependent on available memory size
but runs faster and the executable is smaller. Fixed problem
occurring when using -b switch. Used to hang the computer.
Fixed problem occurring with files >2500 lines.

grep.exe
more.exe : The regular expression operator '|' has been changed to the
'!' character. This was done because the DOS command
interpreter always interprets the '|' character, even when
it is within a string. This means that it is impossible to
use the '|' character as part of an argument to a program.
The '!' character is not recognized by DOS and thus will
not cause the problem.

ls.exe : ls .. now works correctly. Before, ls would not display
anything. ls /l used to change filenames to lower case,
even when they were supposed to be printed as upper case.
This is now fixed.

more.exe : now displays the correct argument list in the help screen.

ncd.com : ncd validdir/.. now works correctly. Before, ncd would
usually remain in the current directory. Now ncd searches
for the directory validdir on CDPATH and then does the ..

pwd.com : pwd again allows for arguments to specify the drives to be
checked for their current directory. The option -a checks
all drives.

mv.com
mvdir.com : mv and mvdir now set the destination file's time and date to
be the same as the source files time and date. They also
delete the destination file when any error occurs while
writing the file. Before they would just leave a partially
written file around. mvdir now tries to rename the source
directory to be the destination directory before actually
copying the directory over.

wc.com : now correctly counts the number of characters in the file.




First Dated Release: January 1, 1987

Included in first dated release:

cat.exe chlabel.exe chmod.exe cp.exe cpdir.exe
df.exe diff.exe du.exe
fgrep.exe grep.exe ls.exe
more.exe mv.exe mvdir.exe ncd.exe
ndate.exe necho.exe nset.exe unset.exe pwd.exe rm.exe
show.exe strings.exe switchar.exe tee.exe touch.exe wc.exe

New in this release:

ndate.exe nset.exe unset.exe ntime.exe strings.exe

Modified in this release:

All of the utilities have had the following changed:
1) The accent grave processing in the command line has
been added. The single escape character has been
changed to a pound sign '#' when the switch character
is the forward slash '/'.
2) if a drive specifier is provided to a filespec, a slash
character is inserted after the ':' if one is not
already there. For example,
cp a:this .
will become a:/this before cp checks for the file.

cp.exe, cpdir.exe, mv.exe, mvdir.exe:
Modified the buffer size for copies to 32K from 8K.

diff.exe : fixed the case where a directory is given as one of the
filenames. Before, the entire pathname of the other
argument was appended to the directory name. Now, only
the filename part of the other argument is appended to the
directory.

fgrep.exe : fixed -i (ignore case) option. Before fix, lines with
matching pattern were printed in all lower case. Now,
lines with matching pattern are printed as they were
read from the file.

grep.exe : added -i (ignore case) option. Before, this option would
report that it wasn't implemented.

ls.exe : fixed the -u (unsorted filenames) option. Before, sorting
of filenames was done at a very low level and it was not
an option to not do the sorting. Now the low level routines
can be told not to do the sorting.

ncd.exe : changed the method by which the environment is modified.
The old ncd would not work correctly in batch files. It
left a copy of itself around in memory.

pwd.exe : pwd no longer allows arguments other than -?. pwd always
shows the current working directory on the default drive
only.

rm.exe : now correctly removes hidden and system files during the
-r (recursive) option.

show.exe : fixed -p (search path) option. Before fix, if the command
line argument was -pPATH with no space between the -p and
the path, this would not be handled correctly. Also, it
is now allowed to specify the path in lower case, i.e.,
-p path.


 December 31, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)