Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site motel6.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!tektronix!reed!motel6!keith From: keith@motel6.UUCP (Keith Packard) Newsgroups: net.unix Subject: Re: 2.8BSD Bourne shell: no comments? Message-ID: <169@motel6.UUCP> Date: Mon, 24-Jun-85 02:40:34 EDT Article-I.D.: motel6.169 Posted: Mon Jun 24 02:40:34 1985 Date-Received: Wed, 26-Jun-85 05:29:47 EDT References: <1228@uwmacc.UUCP> Reply-To: keith@motel6.UUCP (Keith Packard) Distribution: net Organization: 5440 SE 41st, Portland, OR Lines: 44 Summary: In article <1228@uwmacc.UUCP> jwp@uwmacc.UUCP (jeffrey w percival) writes: >My system doesn't seem to support the '#' comment character. >Is there an easy fix? > >-- > Jeff Percival ...!uwvax!uwmacc!jwp The listing below is extracted from main.c. It represents a major hack that lets # comments work most of the time. They only work if the # is the *first* character on the line, not any other time! It was quick and dirty. It will stay this way until I get the Bourne shell mods for job control. IF (flags&prompt) ANDF standin->fstak==0 ANDF !eof THEN IF mailnod.namval ANDF stat(mailnod.namval,&statb)>=0 ANDF statb.st_size ANDF (statb.st_mtime != mailtime) ANDF mailtime THEN prs(mailmsg) FI mailtime=statb.st_mtime; prs(ps1nod.namval); alarm(TIMEOUT); flags |= waiting; FI trapnote=0; peekc=readc(); ! /* ! * major kludge to allow '#' to delimit ! * comment lines ! */ ! if (peekc == '#') { ! while (readc() != '\n'); ! continue; ! } IF eof THEN return; FI alarm(0); flags &= ~waiting; execute(cmd(NL,MTFLG),0); eof |= (flags&oneflg); POOL } Keith Packard ...!tektronix!reed!motel6!keith