Thursday, May 22, 2008

fine grained difference

aarklon
I was reading the book Ubuntu Linux Unleashed by paul hudson and andrew hudson.

In this book a paragraph is written as follows.

the command line is also known as the shell,the console,the command prompt,and the CLI. For the purposes of this chapter these are interchangeable,although there are fine-grained differences between them.

Now my question is what is this fine grained difference ???


Roy S. Schestowitz

Just a semantic/conceptual difference. It's essentially (in practice) the same thing unless you are being very pedantic or talk about one particular (fine-grain) aspect, e.g. the prompt.


Peter Kohlmann

"shell" can be quite different. You can have bash, tcsh, csh and others as local shells rsh, ssh (for example) as remote shells They all serve slightly different purposes / have different capabilities, yet they all are "shells"

You can have a command-line (a single one) to start an app if you just press ALT-F2 in KDE. It serves as CLI, yet is different from a console

There are differences between those thingies, but they all serve to start / control apps
--
Linux: Because rebooting is for adding new hardware


linonut

shell -- a program that accepts typed commands from stdin, and directs output to stdout and stderr

command prompt -- visual indication that the shell is ready for more commands.

console -- The keyboard/monitor combo; also used for the terminal window (xterm, aterm, rxvt, etc).

CLI -- the interface paradigm used by a shell

The shell runs in a console, using a CLI that produces a command prompt to indicate readiness.


Hadron Quark

Not necessarily. The "shell" supports redirection to any stream. It also accepts and channels input from any stream.

From the Wiki

"Bash syntax simplifies I/O redirection in ways which are not possible in the traditional Bourne shell. For example, Bash can redirect standard output and standard error at the same time using the following syntax."

Bourne Again Shell : Bash

Bash has a CLI

Tricky isn't it actually? Command line, shell, prompt etc are used interchangably and incorrectly all over the place.

command prompt -- visual indication that the shell is ready for more commands.

console -- The keyboard/monitor combo; also used for the terminal window(xterm, aterm, rxvt, etc).

CLI -- the interface paradigm used by a shell

The shell runs in a console, using a CLI that produces a command prompt to indicate readiness.
--

"And spellchecker won;t help." : Roy Schwestowitz

ray
Yes, it can be redirected, but it's still reading from stdin and writing to stdout. The fact that those have been redirected to other resources is purely an external artifice.


The Ghost in the machine
Just to be pedantic: in Windows SHELL.EXE was in fact a program, presumably in W95 (it's since been replaced by Explorer but I don't know the details) which allowed for the user to interact with the system at a pointy-clicky level, plus managed such things as file associations (among them, the infamous "open" = "execute" metaphor, which AFAIK is still in Windows today, though at least now it asks).

So again Microsoft has corrupted the original meaning of the term "shell", and that's assuming Unix didn't corrupt it initially; a more logical term would be "skeleton", "starting point", or just "that darned dollar/hash/percent sign" (depending on shell variant and version). Of course you address the last in your next definition... :-)

Also, on a more relevant note, a shell is extensible (presumably, that's the reason the term "shell" is
used), either by using scripts (with built-in commands) or by loading external commands, modules, or what not and running them.

Tcl in particular allows the loading of additional commands using dynamically loadable libraries. I believe Python can also but do not know the details. Bash fires off subprocesses, as do many other command shells. Perl can be pressed into service as a shell but isn't quite designed for such use.

command prompt -- visual indication that the shell is ready for more commands.

console -- The keyboard/monitor combo; also used for the terminal window (xterm, aterm, rxvt, etc).

There is also the capability, if one's set it up, to allow stdin and stdout and stderr to be redirected through a COM port (/dev/ttySn); such a setup is occasionally called a "serial console", and is usable even today in Linux (just edit /etc/inittab :-) ) though obviously with no graphics as such.

Regrettably, I've lost my null-modem cable. :-)

CLI -- the interface paradigm used by a shell

The shell runs in a console, using a CLI that produces a command prompt to indicate readiness.

The pedant in me is rebelling :-), but certainly the intent is for a user to type in commands into something, which also tells him when it is ready to accept more commands, and the results of those commands. That is the gist of CLI, and certainly Bash, among other shells, implements that idea pretty darned well, especially since 1980-era Unix shells did not have command history.

But text input into a command line shell no longer an absolute requirement in Linux, though typing helps.
It is possible to enter words without typing, though -- dasher is a package in Linux that allows the user to
navigate using the mouse to spell words. The iPhone has a keyboard on its touch-sensitive screen; no hardware (other than the screen) required. A virtual keyboard made from a laser scanner is running around somewhere; one touches the tabletop to type.

Makes life interesting.


The Ghost in the machine

That they are, which may be why users are afraid to approach the command prompt. Of course, I have always wondered in some cases exactly what certain icons mean, even the traditional "save" icon (a floppy disc).

Presumably, at some point, floppies will be passe (they're nearly gone, and that's assuming we're talking about the plastic clamshell 3 1/2" variety, which aren't all that floppy compared to, say, 8" Shugarts -- they "flopped" rather nicely, in the physical sense -- or the more common 5 1/4" variant, which was passed by some time ago, along with 1/4" cartridge tapes, Syquest rigid media, and so-called "Superdrives"), and then that metaphor will have to be replaced. Flyovers help, though one has to still move the mouse around.

But anybody with a modicum of knowledge of English will recognize the word "save", or at least be able to look it up in a dictionary. Gnome has an option to use text, icons, or both in its applications, which is nice. I'm not sure what QT/KDE has in that area.

Internationalization is probably the next frontier (it really shouldn't be, but computer languages have had
embedded strings since FORTRAN days, if not even earlier, and it's a hard habit to give up). Not sure exactly where Linux/Gnome/KDE is here, though Glade in particular clearly has the tools to create text files containing messages. Windows has its registry.

Mentor Graphics used to have a suite of tools that allowed for a user to type in part of a command and then
hit control-question mark, "expanding" the command and showing its options. Such sophistication was possible because MG had more control over its commands than current Unix/Linux shells do, and it was a nice way of showing what options were available in a single command of a complex CAD/CAM/CAE system. However, in 8.0, they went for a form-based system, which IMO wasn't quite implemented
right, though it was also fairly popular.

Squeak isn't exactly a command shell (it's a sandbox environment for a Smalltalk implementation and has a lot of capability, though is not widely used) but presumably a message (Smalltalk's rough equivalent of a command -- and the concept does make sense, as the user is trying to send messages to the system in order to get responses back and change state) can have defaults and could do just about anything, including prompt for more input by sending other messages.

I'll admit to wondering what Powershell will do. With my luck Microsoft will patent it and the USPTO not even look at Mentor Graphics or other CAD/CAM/CAE vendors for prior art.

command prompt -- visual indication that the shell is ready for more commands.

console -- The keyboard/monitor combo; also used for the terminal window (xterm, aterm, rxvt, etc).

CLI -- the interface paradigm used by a shell

The shell runs in a console, using a CLI that produces a command prompt to indicate readiness.


Gelco caveman

The shell is a programming language. The console is a program that allows you to use this language. The command prompt is just that. The command line interface is the method of issuing user commands to the shell program using the console (or its hundreds of cousins).

No comments:

Post a Comment