2 ms·
Influence of Algol 68 doesn't even really explains requirement of semicolons (or equivalently, new lines) in weird places. while false do echo 1 done i
by Joker_vD 2y ago
Influence of Algol 68 doesn't even really explains requirement of semicolons (or equivalently, new lines) in weird places.
while false do echo 1 done
if false then echo 1 fi
argubaly should just work, the presence of do/then/done/fi keywords makes semicolons quite superfluous yet the correct forms are
while false ; do echo 1 ; done
if false ; then echo 1 ; fi
Which is strange, because Algol's grammar actually prohibits ; before ELSE, FI, and OD keywords yet the Bourne shell requires them!
- Koshkin 2y agoWell, to be fair, the use of semicolons in the shell has nothing to do with their use in other languages, here they are simply line separators.