Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kdum8

macrumors 6502a
Original poster
Sep 8, 2006
919
12
Tokyo, Japan
I am clearly new to mac programming and mainly teaching myself.
So I know what a shell is; and I know what the terminal is. They seem to be synonymous. Is this correct?
 

costabunny

macrumors 68020
May 15, 2008
2,466
71
Weymouth, UK
Pretty much yes

Terminal is used to refer to shell access. (there are different versions of the shell aka. Bash, Ksh, sh Ash etc but commonly Bash seems popular) You can find a Wiki page on different shells and what they do.
 

MikeDTyke

macrumors 6502a
Sep 7, 2005
661
0
London
I am clearly new to mac programming and mainly teaching myself.
So I know what a shell is; and I know what the terminal is. They seem to be synonymous. Is this correct?

Correct, though in mac circles 'terminal' seems to refer more to the terminal.app application rather than the session.

M.
 

kdum8

macrumors 6502a
Original poster
Sep 8, 2006
919
12
Tokyo, Japan
Correct, though in mac circles 'terminal' seems to refer more to the terminal.app application rather than the session.

M.

I see, so if you were using other CLI software (and not the terminal.app program) then you might refer to that other software as a "shell" in macland?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
I would say the shell is the program running that provides shell facilities. Examples would be bash, ksh, zsh, and, of course, plain old sh.

Terminal.app simply provides an IO wrapper for the shell program. You could use other wrappers, but the shell would be basically the same.

Edit to add: sorry, matscotted the thread: costabunny already said all this :eek:
 

Berlepsch

macrumors 6502
Oct 22, 2007
303
48
In the olden days of Unix and other mainframe computers, people were usually using "terminals" to connect to the workstations via the network or through modem connections. These terminals were just a keyboard and a monitor for text output. The terminals usually had a fixed command set for displaying text and for transmitting keyboard commands. There were a number of different command set used, e.g. for the DEC VT100 or IBM 3270 terminal.

Once you connected to the workstation through a terminal, you usually opened an interactive program, or "shell" in Unix terms. If you had a task to do that needed a longer time to finish (and 15 or 20 years ago that was quite common), you set it up as a batch job and closed the shell, so that someone else could use your terminal.

The "Terminal.app" in Mac OS, just like "Xterm" under X11, is technically an emulator for those ancient computer terminals. You can even influence some VT100 related settings in the preferences and choose which kind of shell to run.

So, historically, terminal and shell are seperate things, but nowadays we nearly always use them together.
 

kdum8

macrumors 6502a
Original poster
Sep 8, 2006
919
12
Tokyo, Japan
In the olden days of Unix and other mainframe computers, people were usually using "terminals" to connect to the workstations via the network or through modem connections. These terminals were just a keyboard and a monitor for text output. The terminals usually had a fixed command set for displaying text and for transmitting keyboard commands. There were a number of different command set used, e.g. for the DEC VT100 or IBM 3270 terminal.

Once you connected to the workstation through a terminal, you usually opened an interactive program, or "shell" in Unix terms. If you had a task to do that needed a longer time to finish (and 15 or 20 years ago that was quite common), you set it up as a batch job and closed the shell, so that someone else could use your terminal.

The "Terminal.app" in Mac OS, just like "Xterm" under X11, is technically an emulator for those ancient computer terminals. You can even influence some VT100 related settings in the preferences and choose which kind of shell to run.

So, historically, terminal and shell are seperate things, but nowadays we nearly always use them together.


Thanks, that is a very good explanation. :eek:
 

ChrisA

macrumors G5
Jan 5, 2006
12,581
1,697
Redondo Beach, California
I am clearly new to mac programming and mainly teaching myself.
So I know what a shell is; and I know what the terminal is. They seem to be synonymous. Is this correct?

No. They are not the same thing. A shell is a program that accepts commands and executes them. It is a kind of interpeter. It can read commands from either the user as he types or from a file.

The terminal is a software emulation of a physical device. In the past there were real "terminals". These had CRTs and keyboards and connected to a computer with a serial cable.

The shell reads commands from the terminal and prints it's results back to the terminal but other programs can do this as well. For example the "Hello World" program prints to the terminal.

Technicalls the shell reads and writes to "standard input" and "standard output". When the shell process is created it's "standard input" and "standard output" are by default connected to a terminal, but this need not be the case. For example when you run a shel script the shell process' standard input is connected to a file.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.