←back to thread

412 points conanxin | 1 comments | | HN request time: 0s | source
Show context
pavlov ◴[] No.41085505[source]
The CLI has a massive blind spot in today’s operating systems: it knows nothing useful about events.

Yet events are the primary way anything happens on a computer, whether it’s a user system or a server.

replies(6): >>41085537 #>>41085570 #>>41086080 #>>41087545 #>>41088178 #>>41090695 #
1. dredmorbius ◴[] No.41090695[source]
That's the specific hole which Expect fills for scripting:

<https://en.wikipedia.org/wiki/Expect>

Much of modern operating systems is events-based and relies on polling for specific actions, devices connecting / disconnecting, etc. Linux device management is based on this, for example. There are numerous scripts which fire as a service is enabled or disabled (networking "ifup" and "ifdown" scripts, for example), or services are started / stopped. Systemd extends these capabilities markedly.

And of course there's a whole slew of conditional processing, beginning with init scripts, [], test, &&, ||, and specific conditional logic within shells, scripting, and programming languages.