← Back to context

Comment by zokier

11 hours ago

Bit of pedantry but I don't think traditional unix shell (like this) follows repl model; the shell is not usually doing printing of the result of evaluation. Instead the printing happens more as a side effect of the commands.

I remember my first shell programming I ever did was batch in windows back in the 3.11/95 days.

The first line was always to turn off echo, and I've always wondered why that was a decision for batch script. Or I'm misremembering. 30 years of separation makes it hard to remember the details.

  • Echo in that case prints command lines before executing them. Its analog is `set -x` rather than `echo`.

It’s a shell, not the whole thing. The whole thing is the shell+kernel+programs.

  • Even if you view the system as a whole the printing is deeply intertwined with the evaluation, which is very different from repl where eval returns a value and print prints it