As usual, keep a log in the file lab4.txt of what you do in the lab so that you can reproduce the results later. This should not merely be a transcript of what you typed: it should be more like a true lab notebook, in which you briefly note down what you did and what happened.
You're helping to develop an operating system and command set that as part of its acceptance test is supposed to pass a large test suite maintained by a large government agency. The test suite is pretty much carved in stone: it was written five or ten years ago and contains some bugs, but it takes months (maybe years) to get it fixed, because of all the bureaucracy involved in getting fixes approved for a benchmark used in competitive bidding processes. Your company's product is failing several of the tests, and you've been assigned to fix one of the failures.
You track your assigned failure down to the following test:
mkdir test cd test touch ./-ooops a b c rm *
The test suite expects your implementation of rm to output the following:
rm: invalid option -- 'o' Try `rm --help' for more information.
Instead, your rm, which is based on Coreutils 8.0, outputs an extra line, generating:
rm: invalid option -- 'o' Try `rm ./-ooops' to remove the file `-ooops'. Try `rm --help' for more information.
The extra (middle) line is supposed to be helpful, but the test suite doesn't expect it and it rejects your implementation of rm. This is a bug in the test suite (it should not be so picky), but fixing the bug will take a long time and in the meantime your product will get a lower score.
You search the Internet for ideas, and find a coreutils patch posted 2005-08-29 that explains why Coreutils rm outputs the extra line. You decide to work around the bug by backing out this patch: that way, the modified version of rm will output the old message.
Back out the 2005-08-29 patch, as follows:
You're happy with the backed-out patch that you prepared in your assignment, but now you'd like to publish this patch, in a form similar to that presented in the original patch, so that others can use it.
Submit the following files.
All files should be ASCII text files, with no carriage returns, and with no more than 100 columns per line. The shell command:
expand lab4.txt lab4.diff hw4.patch | awk '/\r/ || 100 < length'
should output nothing.