[TUHS] Bourne shell and comments

Michael Kjörling michael at kjorling.se
Fri Apr 21 23:20:22 AEST 2017


On 20 Apr 2017 21:28 -0600, from arnold at skeeve.com:
>> The # was nod to the # being the first characters of the C program to say
>> to use the preprocessor; but I've forgotten why the bang was added before
>> the path.    It could have been almost anything.
> 
> Perhaps reminiscent of the '!' escape to shell in ed and maybe
> some other interactive programs of the time?  That's purely a guess
> on my part.

How about that # could start a C preprocessor directive, but no C
preprocessor directives begins with `!'? Makes it easy for the C
compiler or preprocessor to check that it isn't being fed a random
script.

-- 
Michael Kjörling • https://michael.kjorling.semichael at kjorling.se
                 “People who think they know everything really annoy
                 those of us who know we don’t.” (Bjarne Stroustrup)


More information about the TUHS mailing list