-3

If I'm not wrong, tty is composed of:

  • Line discipline
  • TTY driver

In addition, a shell (bash, for example) is a program that execute different commands/programs like ls, mkdir, rm, ...

After reading this post, I guess the shell is the same as TTY driver, because they share some features like job control, but I'm not sure at all.

So, are the shell and tty driver equivalent?

Please, correct me if something I wrote is wrong.

marked as duplicate by Ipor Sircer, Celada, Satō Katsura, thrig, Community Jan 22 '17 at 18:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Yes, but the information given by @Kusalananda was essential for me. – antnolang Jan 22 '17 at 18:04
2

Have a look at the accepted answer again. A TTY is a terminal device, the shell is a command line interpreter (or "command language interpreter"). These are two very distinct things. A TTY doesn't have job control.

From the POSIX Base Definitions:

Terminal (or Terminal Device); A character special file that obeys the specifications of the general terminal interface.

Command Language Interpreter; An interface that interprets sequences of text input as commands. It may operate on an input stream or it may interactively prompt and read commands from a terminal. It is possible for applications to invoke utilities through a number of interfaces, which are collectively considered to act as command interpreters. The most obvious of these are the sh utility and the system() function, although popen() and the various forms of exec may also be considered to behave as interpreters.

  • 1
    Note that system() and popen() do invoke sh to parse the command line provided to them. – Stéphane Chazelas Jan 22 '17 at 18:05

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