-------------------------------------------------------------- USING DIFF TO SEARCH FOR DIFFERENCES IN THE OUTPUT If you want to compare your output files to the class output files, you can perform the following on replit. (These commands create a directory called answer containing the class output files and then compare the first output file.) mkdir answer At this point, you need to download the answer from the course website. Then upload the files into replit. After getting all the files into replit, you can move them into a folder named answer mv out1*.txt answer After you have run your program and produced an output file named out1-01.txt, you can compare your output with the class output file using either: diff out1-01.txt answer/out1-01.txt or diff out1-01.txt answer The second one works because if "diff" is passed a directory for the last argument, it assumes that the file name in that directory is the same as the first filename. If the output matches, you can move on to: diff out1-02.txt answer diff out1-03.txt answer diff out1-04.txt answer diff out1-05.txt answer If the two files are both text files and every character matches, then the output is nothing at all. This is what you want! Otherwise, the output from diff identifies differences between lines in the two files. "<" marks lines in the first file that do not match the second file, and ">" marks lines in the second file that do not match the first file. Detailed examples are given below for the "c" = change, "d" = delete, and "a" = append output. -------------------------------------------------------------- An entry such as 86,87c256,257 < ** PID R0 R1 R2 R3 PC PS BA LEN UT ST IN < ** 0 0 20 1 4 2 0 50 3 11 8 (0,sys DisplayRegisters) --- > ** PID R0 R1 R2 R3 PC PS BA IN > ** 0 0 20 1 4 2 0 50 (0,sys DisplayRegisters) means that after matching some lines, the diff program found a difference between lines 86-87 in the first file and lines 256-257 in the second file. The content of the relevant lines in the first file is given by the lines prefixed by "< " and the content of the relevant lines in the second file are given by the lines prefixed by ">". The "---" line is just to help you separate the pieces from the two files. -------------------------------------------------------------- An entry such as 65a165,169 > ** 13 (0,-----) > ** 14 (0,-----) > ** 15 (0,-----) > ** 16 (0,-----) > ** 17 (0,-----) means that to make the files look the same, just after line 65 in the first file, you need to add lines 165-169 from the second file. -------------------------------------------------------------- An entry such as 165,169d65 < ** 13 (0,-----) < ** 14 (0,-----) < ** 15 (0,-----) < ** 16 (0,-----) < ** 17 (0,-----) means that to make the files look the same, you need to delete lines 165-169 in the first file.