4 ms·
Sounds like what you're looking for is the original Bash source code, circa 1977, for example [1]: LOCAL STRING copyto(endch) REG CHAR endch; { REG C
by marcusf 14y ago
Sounds like what you're looking for is the original Bash source code, circa 1977, for example [1]:
LOCAL STRING copyto(endch)
REG CHAR endch;
{
REG CHAR c;
WHILE (c=getch(endch))!=endch ANDF c
DO pushstak(c|quote) OD
zerostak();
IF c!=endch THEN error(badsub) FI
}
Applicable macros if you want to give your code that classic ALGOL 68 smell in [2].
[1] http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/macro.c http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/...
[2] http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/...
- phillmv 14y ago"An original idea. That can't be too hard. The library must be full of them."
- kabdib 14y agoI remember going through that code, and wanting to simultaneously reach for a spraycan of holy water, and claw my eyes out. Similar efforts (the linguist at DRI who did a #define of totally new control structures . . . in Russian, though he wasn't Russian, it was just a lark) are why we can't have nice things.
- jff 14y agoHate to be pedantic, but that's the Bourne shell, not bash.
- marcusf 14y agoYup, totally correct and really not that pedantic. I realized that about two hours later when I reviewed my own comment and promptly punched myself…
- pavlov 14y agoI wonder why IF closes with FI, REP closes with PER and LOOP closes with POOL, but SWITCH fails to complete the series: it closes with ENDSW... Why not go all the way with HCTIWS, when you've already abandoned your sanity to Cthulhu?