Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site moncol.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!houxm!vax135!petsd!moncol!john From: john@moncol.UUCP (John Ruschmeyer) Newsgroups: net.jokes,net.sources.bugs Subject: Re: new 'echo' Message-ID: <258@moncol.UUCP> Date: Wed, 17-Apr-85 20:12:21 EST Article-I.D.: moncol.258 Posted: Wed Apr 17 20:12:21 1985 Date-Received: Thu, 18-Apr-85 05:23:08 EST References: <6265@ucbvax.ARPA> Organization: Monmouth College, West Long Branch, NJ 07764 Lines: 33 Xref: watmath net.jokes:11778 net.sources.bugs:287 As posted, the new 'echo' program has several bugs all stemming from missing 'break' statements in the loop which parses the arguments. The only visible bug, however, is that the '-n' option will also select the '-q' option and nothing will be printed. Also, the '-q' option should cause the '-n' option to be selected by default. This allows the program to be used to create an empty file, as in: echo -q foo >newfile The following diff shows the corrections which will take care of both problems: 16,18c16,18 < case 'n': nflg++; < case 'q': qflg++; < case 'r': rflg++; --- > case 'n': nflg++; break; > case 'q': qflg++; nflg++; break; > case 'r': rflg++; break; -- Name: John Ruschmeyer US Mail: Monmouth College, W. Long Branch, NJ 07764 Phone: (201) 222-6600 x366 UUCP: ...!vax135!petsd!moncol!john ...!princeton!moncol!john ...!pesnta!moncol!john Silly Quote: "Ah, but what is a dream but reality without a backbone?"