Author: Stan Eisenstat
Subject: Re: [Cs223] Test 11
Date: Tuesday, 25 Feb 2020, 19:21:30
> Message Posted By: Unknown > > I am running your test script using the input: > baba > abab > baba > > When I run /c/cs223/Hwk3/strwrs -n a- b < newfile.c > (newfile.c contains the text above), I am getting the output: > > baba > abab > babb > > Which is strange since the first line should correct to babb... My code is > outputting the same thing, and I'm confused as to why this would be. The most likely explanation is that newfile.c was created under Windows and that each line ends with a carriage return followed by a newline. (You can test this conjecture by seeing if the output of the command % cat -vet newfile.c is abab^M$ baba^M$ where the ^M represents a carriage return.) If so, then the last character is not an a and a- does not match. Please let me know whether this conjecture is correct. --Stan-PREV INDEX NEXT