Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site elsie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!seismo!rlgvax!cvl!elsie!ado From: ado@elsie.UUCP Newsgroups: net.unix-wizards Subject: Re: Bizarre Bourne Shell Message-ID: <922@elsie.UUCP> Date: Thu, 17-May-84 22:53:19 EDT Article-I.D.: elsie.922 Posted: Thu May 17 22:53:19 1984 Date-Received: Sat, 19-May-84 00:00:40 EDT References: <1820@sdccsu3.UUCP>, <696@CS-Arthur> Organization: NIH-LEC, Bethesda, MD Lines: 65 sdccsu3!hardy-- > I will not even comment on those brain-damaged individuals who insist > upon "improving" the C language with macros like IF, THEN, ELSE . . . . CS-Arthur!avr-- > But I will. It's done in 'adb', too, which I'm doing something with, > and its a royal pain - looks ugly as BabaYaga, too. UGH! Rather than bemoaning the situation, perhaps the thing to do is overcome it. The shell file below may be a start on doing so. If, on a 4.1bsd system, you name it "reborn" and then use the command reborn filename where "filename" is the name of a Bourne-style C program, a "more-traditional" version of the source code is written to the standard output. The script below is a quick hack, so expect the worst--little testing was done. Surely a more portable and otherwise improved version can be created. Is doing so worth it? Is anyone up to it? ----------------SHELL SCRIPT STARTS AT THE NEXT LINE----------------------- : The superfluous cat below makes up for the fact that cb gives a bogus : exit status on some systems. ex - $1 << 'THIS IS WHAT TO LOOK FOR' | tr -d "\015" | cb | cat g/\/s//static/g g/\/s//extern/g g/\/s//typedef/g g/\/s//typedef struct/g g/\/s//typedef union/g g/\/s//register/g g/\/s//if(/g g/\/s//){/g g/\/s//} else {/g g/\/s//} else if (/g g/\/s//;}/g g/\/s//{/g g/\/s//}/g g/\/s//switch(/g g/\/s//){/g g/\/s//}/g g/\/s//for(/g g/\/s//while(/g g/\/s//){/g g/\/s//;}/g g/\/s//do{/g g/\/s//}while(/g g/\/s//);/g g/\/s//for(;;){/g g/\/s//}/g g/\/s//;/g g/\/s//\//g g/\/s//%/g g/\/s//^/g g/\/s//\&\&/g g/\/s//||/g g/^ *){/.-1j g/){/s//&\ / 1,$p q! 'THIS IS WHAT TO LOOK FOR' exit -- UNIX is an AT&T Bell Laboratories trademark. -- ...decvax!allegra!umcp-cs!elsie!ado (301) 496-5688