3

Are there terms that are used to describe what kind of command line program you are programming based on how the program is designed to interact with the user?

For example, I can write a program that

a.) gets invoked from the command line with optional parameters, executes, and then immediately returns control back to the shell. (i.e ls)

b.) gets invoked and then waits for the user to make certain decisions as part of a workflow, before continuing execution and exiting. (i.e. ssh-keygen)

c.) gets invoked and then begins mimicking a shell, expecting the user to type in commands to execute and has a separate exit call to return to the the shell (i.e. mysql, NodeJS or Python REPL)

d.) fully takes over the window, mimics an application and doesn't leave a history of commands in the shell (i.e. vim)

Historically, have software developers come up with terms for classifying these kinds of programs or have they all been grouped together as "command line interfaces"?

Update:
Based on scriptin's comment about this potentially being more about properties of software rather than overall classification, here is another way to phrase this question-

Say I am writing a set of tutorials to teach a student a programming or scripting language, starting from a "Hello world" example to a fully useful application and the above cases are treated as separate tutorials. Are there non-subjective terms to describe the concepts, features and behaviors I am asking the student to learn how to program in each of the cases? In other words, what would I title those tutorials?

  • c) is called REPL, as you've mentioned. Also, since many REPLs and editors like vim/emacs have options to be used like a), it is pretty hard to classify those. I think it's just a matter of having different properties, such as interactivity, command history, and which means of input and output are used. – scriptin Apr 18 '16 at 23:13
  • There's an additional dimension of subcategories: (1) operates on strings as given on the command line directly (e.g. grep pattern) (2) operates on strings as listed in a file (e.g. grep -f patternfile) (3) operates on strings as provided into stdin (e.g. grep -f - searchfile). These are all in category (a) of your list, though, although the last one won't do anything until you type ^D so it's arguably in category (b). – Wildcard Apr 19 '16 at 0:03
4
  1. Non-interactive command
  2. Interactive command
  3. REPL
  4. Windowed / screen application

I don't have a source for that; just years of hearing them called the same way. I'll see if I can find an authoritative source.

2

Shell, script, or application there are two different classifications here:

Interactive and non-interactive

An interactive shell reads commands from user input

A shell running a script is always a non-interactive shell. All the same, the script can still access its tty. It is even possible to emulate an interactive shell in a script.

...

Let us consider an interactive script to be one that requires input from the user, usually with read statements

Advanced Bash-Scripting Guide: 36.1. Interactive and non-interactive shells and scripts

What the shell, script, or application does interactively varies widely. Consider, MS windows is really an interactive shell. So this isn't limited to the command line.

a Is really your only non-interactive case. b-d are interactive but can all be made non-interactive by feeding them redirected input. So technically, all you know when you write a program is that it MIGHT be run interactively.

  • For each case a-d, can I classify it as either a shell, script or application knowing that the only interface is via a command line? – Ryan Jarvis Apr 19 '16 at 13:26
  • And also, are you suggesting that are no subclassifications for the kinds of interactivity? – Ryan Jarvis Apr 19 '16 at 13:27
  • I'm suggesting software is interactive or it's not. There are many many many subclassifications. There are many ways to be interactive. There are also many ways to not be interactive. – candied_orange Apr 20 '16 at 4:26
  • @RyanJarvis generally yes, I would say the community has no subclassification of interactivity types that it commonly refers. Where does one draw the line between human I/O speeds, and machine I/O speed via streaming input? – New Alexandria Apr 24 '16 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.