25 Aug
2020
25 Aug
'20
9:01 a.m.
I posted the below puzzle to Twitter, where no one has solved it. I think it’s too hard. Although it’s a silly question, the method of solution is quite interesting IMHO. (The computation would be doable by hand, if one were patient and careful, but can be done more easily and reliably by a computer.) I know some of you are aware of a related problem I solved a few years ago. The method of solution of this one is related, but not identical. Cheers, Robin A Unix shell puzzle. If you were to run this script – which I don’t recommend doing – how many occurrences of $x would appear in the output? x=\"\'\$x\'\"\$x\'\"\$x\"\' eval x=$x eval x=$x eval x=$x eval x=$x eval x=$x eval x=$x eval x=$x eval x=$x eval x=$x eval x=$x echo "$x"