in reply to CGI example

(smile...)

Think about it:   what does “a CGI application” actually do?

Answer:   it generates HTML-output, which is then (somehow) sent back to the user's web-browser as input so that the web-browser will now interpret that HTML and make a pretty picture.

(Let me clarify this:   someone else (Apache...), not the CGI-application, is responsible for “getting the output back to someone's web-browser.” Whatever the CGI-program may print gets captured, and that becomes what gets sent back... but the CGI-program, itself, doesn't do that part.)

Run a CGI-program from the command-line and what do you get? HTML! But that HTML isn't being fed into anything; there's no browser involved to take that HTML and act upon it. All you get is... HTML, printed on the console.