More...

DOS Commands

End of Line and End of File

  • In DOS
    • Each line is terminated with a carriage return (^M ) plus a linefeed (^J )
    • End of file is triggered by a ^Z
  • In AIX
    • Each line is terminated with a line feed only (^J)
    • End of file is triggered by a ^D

Other commands and their associated decimal value or mnemoic.

Command Menomic ASCII Code String Value
Line Feed LF 10 \n
Form Feed FF 12 \f
Carriage Return CD 13

\r

New Line NL 13, 10 \r\n
XOn DC1 17 (None)
XOff DC3 19 (None)

top of page


dosdel

Deletes a DOS file

Example:dosdel -D/dev/fd1 test.dat
Deletes the file 'test.dat' in the current directory. If the file to be removed was found on /dev/fd0, the -D/dev/fd1reference would not have been needed because the default floppy device is fd0

top of page


dosdir

List the directory of DOS files. If the diskette does not contain a DOS filesystem, the following error message is displayed: DOS filesystem invalid or inaccessible

Default floppy device = /dev/fd0

Examples:

  • dosdir -l
    -l long listing (file size, creation date, and attributes)
  • dosdir -v
    Displays attributes about the format of the disk. You can use the -v flag to verify that a device is a DOS disk.

top of page


dosformat

Formats a DOS diskette

Example:dosformat -D/dev/fd0

  • /dev/fd0 = 3.5", 1.44MB diskette
  • /dev/fd0 -4 = 3.5", 720KB diskette
  • /dev/fd1 = 5.25", 1.2Mb diskette
  • /dev/fd1 -4 = 5.25", 360Kb diskette

top of page


dosread

Copies DOS files to AIX files

Examples: dosread -a DOS.FIL aix.fil
-a replaces the Return/LineFeed with Newline and ^Z with ^D

To copy all the files on the DOS diskette...

cd $HOME (go to your home directory )
mkdir dos (create directory named dos )
cd dos
for i in `dosdir|grep -v "^Free"`
    do
        echo Copying $i...
        dosread -a $i $i
    done

Ignore error message displayed when you first execute the script.

To rename those files that were just taken off the DOS diskette FROM uppercase TO lowercase, use the following script:

for i in `ls`
do
    lower=`echo $i|tr '[A-Z]' '[a-z]'`
    mv $i $lower
done

top of page


doswrite

Copies AIX files to DOS files. The diskette mustbe formatted for DOS. To copy a BINARY file, don't use the -a option with this command.

Example doswrite -a aix.fil DOS.FIL
-a replaces NL with CR/LF and ^D with ^Z sequence

top of page

Send Email © Advanced Horizons, Inc. All Rights Reserved