Hacker News new | ask | show | jobs
by OscarCunningham 1578 days ago
The second paradox.sh in './paradox.sh ./paradox.sh' isn't run at all. It's soucre gets read in as input to behave_differently.sh.
1 comments

yes, and then behave_differently.sh runs it to capture and modify its output, but without any arguments
Note that behave_differently.sh takes two inputs, both a program and the input for that program. Also note that paradox.sh gives both these inputs by using $1 twice.

And behave_differently.sh is supposed to be an arbitrary program. It can run the input program but it doesn't have to, it can analyse it in any way it wishes.

It is a good point that behave_differently.sh does not necessary run its argument program, but can analyze it in another way. (The context of Bash scripts suggests execution but that is a misleading hint.)

In the broader formulation behave_differently.sh tells that its argument program terminates and produces finite input, which is a halting problem.