3 ms·
> Is there a strong reason why all shells have this crazy syntax? Stephen Bourne was a fan of Algol. The source to the shell is… interesting. Via a bunch of p
by kps 8y ago
> Is there a strong reason why all shells have this crazy syntax?
Stephen Bourne was a fan of Algol.
The source to the shell is… interesting. Via a bunch of preprocessor macros, the (C) code looks like:
IF !letter(*cp)
THEN return(FALSE);
ELSE WHILE *++cp
DO IF !alphanum(*cp)
THEN return(FALSE);
FI
OD
FI
return(TRUE);
- fanf2 8y agoThe bournegol macros are defined in https://minnie.tuhs.org//cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h https://minnie.tuhs.org//cgi-bin/utree.pl?file=V7/usr/src/cm...