Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I haven\'t found an answer to this that was right yet so: Write a program in C w

ID: 3586183 • Letter: I

Question

I haven't found an answer to this that was right yet so:

Write a program in C which functions as a DOS command interpreter. DOS uses the commands cd, dir, type, del, ren, and copy to do the same functions as the UNIX commands cd, ls, cat, rm, mv, and cp. Your program loops continuously, allowing the user to type in DOS commands, which are stored in the variables command, arg1 and arg2. The command should be considered by a case statement, which executes an appropriate UNIX command, depending on which DOS command has been given. The program should echo the following instruction to the user: Type Ctrl-C to exit.

Explanation / Answer

Cat-Display file Contents.

Cd-Changes Directory to dimame.

Ls-Display information about lfile type.

Cp-Copy source file into destination.

Mv-More (Rename)a oldname to newname.

rm-rm is a basic UNIX commamd use to remove objects such as file ,directories,device nodes,symbolic links, and so on from the filesystem.

cp-cp is a unix command for copying files and directories.The command has tree principal modes of opertion,expressed by the types of arguments.

dir-In computing, dir(directory) is a command used for file and directory listing,specifically in the command line interface of the os CP/M,DOS,OS/2,Singularity,Microsoft Windows and in the DCL.

type-type(Unix) in unix, type is a command that describes how its aguments would be interpreted if used as command names.

del-In Windows powerShell, del and erase are a predefined command alines for the Remove-Item cmdlet which bacically rervers the same purpose.

Syntax:-

del filename

erase filename

DOS variable commands uses example

@ECHO OFF

SET num=38

SET/A run=%num%

ECHO ON