| This is thetalk page for discussing improvements to theUnix shell article. This isnot a forum for general discussion of the subject of the article. |
Article policies |
| Find sources: Google (books ·news ·scholar ·free images ·WP refs) ·FENS ·JSTOR ·TWL |
| This article is ratedStart-class on Wikipedia'scontent assessment scale. It is of interest to the followingWikiProjects: | |||||||||||
| |||||||||||
1) This descriptions is somewhat primitive and wrong.
2) The best definition comes from the man page of the kornshell:As shell .. is a command and programming language that executes commands read from a terminal or a file.
The ingenuity is that Unix separates between a character terminal (and its emulation like xterm), where you do all the typing and the shell which executes them.A terminal is usually remote and, in the most basic form, the shell does not see an commands one typed until you hit enter.
A console is a HUI that is directly connected to the Unix node (Keyboard, graphic card, screen)were a character terminal, such as a vt100, is a self contained unit of keyboard and a screen anda little memory that is connected via a serial line.
Today with the use of graphic (X11) terminals th scenario is more complex butthe basic the principal is the same.
The fore the DOSish term "command line" is not correct and not used in the proper Unix documentationand should be removed.
3) cmd and similar Windows apps may be POSIX compatible but certain no Unix-Shellsand references should be removed.
4) Users can select the login shell with cnsh and change there current shell with
exec <shell name>e.g.exec zsh
These are two things.
5) No not any program can be a login shell. Only thin mentioned in:
cat /etc/shells /bin/sh/bin/bash/sbin/nologin/bin/tcsh/bin/csh/bin/ksh
6) A shell distinguishes from other programming languages in the way that italmost always calls external commands to implement a functionality combined with pipelines/filters ....
—Precedingunsigned comment added byAhaack29 (talk •contribs)04:10, 14 November 2007 (UTC)[reply]
I don't like the fact that we're now making up our own definition. I'd much prefer a lede that gives the minimal, prosaic definition first:
This historical route should allow us to stay clear of semantic issues, in particular the eternal discussion about what is and what is not Unix-like.QVVERTYVS(hm?)21:53, 23 November 2015 (UTC)[reply]
I couldn't really decide on the proper naming here. I've tried to useunix shell as the more generic term, and a better one thanshell, and use things likebourne shell for the more particular terms. comments? --drj
On a lot of linux (and bsd?) systems out there, /bin/sh is still the default, but it is really just a symlink to /bin/bash or similar. Perhaps this could be incorporated?
InMac OS X v10.4 sh is installed, but bash is the default shell.Dread LordCyberSkull✎☠ 10:49, 2005 September 1 (UTC)
dash[2], which is designed to be small andsh-compatible, and can be used as the symlink at/bin/sh; searching for that, I also came upon something calledshish[3] . The point being that many shell-scripts use this as theirshebang line, so they'll run more efficiently if you symlink it to something more efficient. -IMSoP12:45, 1 September 2005 (UTC)[reply]There's lots more could go in here. It doesn't take too long to describe the family tree of the various Unix shells, and compare a few features. Is it really true to describe Bourne as merely thede facto standard? I remember (but can't remember the details) that there was a "shell war" in the Early Days, which Bourne won (over another Bell Labs competitor, I think; definitelynotcsh). I assume all these curious links to a subpage calledbin are just overzealous wikification?User:Tim Goodwin
I was searching the wikipedia to know why a unix "shell" is called so. Might be a good idea to put it in... --BilboEd
I've resorted the list of shells at the bottom of the page by whether they are compatible with Bourne, C shell, or neither. (And before you ask whyrc andes don't get their own category...because Bourne and C-shell are the traditional major Unix shells, whilerc doesn't seem to be widely used outside of Plan 9 andes, the onlyrc-compatible shell, has apparently been abandoned since 1997, that's why.)Beinsane07:18, 25 December 2005 (UTC)[reply]
Just wanted to point out some inaccuracies on those pages. Please bear with me, I'm not familiar with wikipedia, and English is not my mother tongue.
I read:
The term shell also refers to a particular program, namely the Bourne shell, sh.
That is quite an incorrect way to approach it. I would rather say that. The term shell refers to the sh program. sh having taken different forms along Unix history from the Thomson shell, going through the Bourne shells (all its implementations) and now modern shs. modern shs are now defined by an open specification that is mostly a superset of the Bourne shells. So the "sh" of the modern Unices are one implementation or the other of that specification. Known implementations of the sh specification are ksh (the first one and from which was derived the specification), bash (when called as sh), FreeBSD shs (Almquist shell based), zsh (when called as sh), pdksh and its derivatives (posh, MirBSD ksh...). Some systems like Solaris have more than one sh program: the standard one and a Bourne shell for backward compatibility for scripts written in a Bourne syntax before the sh specification was released (somewhere in the early nineties).
The Bourne shell is generally no longer located as /bin/sh. It is only the case on some very rare systems (like Solaris cited above). Many systems don't have a Bourne shell at all anymore, and when they have one, it's generally either in a non standard place such as /usr/old/bin or has a different name such as bsh or sh.bourne. The sh code wasn't made free until very recently. That's why no Free Unix system ever had it (exception of early BSDs which was the cause of law suites, BSDs then adopted the Almquist shell which was a free reimplementation of the Bourne shell as it could be found on SysV with some extensions and has now been made POSIX (modern sh) conformant).
Many scripts are still written in a Bourne compatible syntax, but just because it is the greatest common denominator of the shs of the past and current Unices. sh is often confused with the Bourne shell because sh has been the Bourne shell on many systems for a long period of time.
Some comments about Windows shells. It can be noted that all the Free Unix shells (zsh, bash, pdksh...) are available to Windows via the Cygwin free Unix adaptation software.
The echo $SHELL to determine the current shell is not correct. $SHELL is the prefered shell of the user. It is initialised by "login" as the user's login shell and can be modified by the user to tell applications which is his shell of choice. ps -p "$$" is more likely to tell which shell is currently interpreting that command line (ps -p $pid for rc/es)—Precedingunsigned comment added byStephane Chazelas (talk •contribs)16:50, 9 September 2006 (UTC)[reply]
Thanks, --Abdull (talk)20:38, 3 March 2010 (UTC)[reply]
Asuggestion has been made by Hm2k that theUnix shell article be merged with theShell (computing) article and that we should discuss here.
Many users of a Unix system still find a modern command line shell more convenient for many tasks than any GUI application.
Should be removed.—Precedingunsigned comment added by92.7.74.215 (talk)07:00, 5 January 2011 (UTC)[reply]
What makes one shell different from another? The article explains what a shell is and goes through a list of them, but what is the difference? Doesn't one Unix/Linux command on one shell run on another? -Rolypolyman (talk)05:27, 22 January 2011 (UTC)[reply]
Pipeline notation existed in the Unix shell (for example in fifth-edition Unix) before the Bourne shell appeared; an early paragraph here implies that the Bourne shell introduced pipelines. -- Jack Waugh
The article currently says:
I could try to guess what this was supposed to really mean.
What it actually says is patently untrue. Nothing prevents an ordinary user from using invoking a new shell, and choosing from any of the shells on the system.
Thechsh program, which changes the default shell field of /etc/passwd, has been available for decades to allow ordinary users to change their default shell, so even changing the default shell does not require the user have superuser privileges.
For what it is worth, nothing requires the default shell for a userid to be a command line interpreter. If a system had some users who insisted they only wanted to use the system for editing, and never wanted to figure out how use any of the system's other confusing programs, their default shell could be changed to an editing program.Geo Swan (talk)16:55, 14 October 2011 (UTC)[reply]
The sectionConfiguration files for shells says/etc/csh.cshrc and/etc/csh.login are used by csh. This seems not to be true for csh of SunOS 4.1.4. I have tested it, and the man page for csh says:
FILES ~/.cshrc Read at beginning of execution by each shell. ~/.login Read by login shells after .cshrc at login. ~/.logout Read by login shells at logout. ~/.history Saved history for use at next login. /tmp/sh* Temporary file for `<<'. /etc/passwd Source of home directories for `~name'.
The article says:
On Unix systems, the shell is still the implementation language of system startup scripts, including the program that starts the windowing system, the programs that facilitate access to the Internet, and many other essential functions.
I believe that is not completely true. Thesystemd folk are trying pretty hard to eliminate the shell's role in starting up a system.— Precedingunsigned comment added by89.67.52.124 (talk)15:22, 21 July 2013 (UTC)[reply]
— Precedingunsigned comment added byTheowoll (talk •contribs)18:04, 16 March 2013 (UTC)[reply]
The fact that the templatemain exists, does not mean it should be used in every situation. The usage here is against what even the template documentation states. It should not be used in avoidance of inline links. People do this all the time unfortunately without examining the merits. Thesemain links are disruptive to section and article flow. The emphasis becomes navigation rather than content. Having a section title, then a main link, and another mention of the same title in the first sentence of the section, often the very first words, makes for poor style. A simple inline link is completely sufficient.Kbrose (talk)18:23, 3 April 2014 (UTC)[reply]
RJaguar3 has questioned the fair use of the desktop image,File:TcshAndShScreenCapture.png, that appears at the top of this article arguing,"A free image could be taken of a command shell in Linux without all the non-free elements (such as the taskbar at the bottom of the image)."
I created the screenshot about 5 years ago and I've offered my thoughts, explaining why I think it's acceptable. But I assume anyone is free to weigh in on the issue with their own thoughts.Msnicki (talk)21:52, 7 March 2015 (UTC)[reply]
{{Di-replaceable fair use disputed}} wouldn't be the right thing to do, as technically there is a possibility for creating a completely free replacement. I'd say that the best we can do isto note there's a related discussion. — Dsimic (talk | contribs)16:02, 13 March 2015 (UTC)[reply]Really, Ken Thompson wrote the original UNIX shell, not Steve Bourne.
Serious use of the shell as scripting language happened in 1975 with [PWB shell], and it describes the history.
Using a Command Language as a High-Level Programming Language was paper at 1976 IEEE COMPSAC Conference.Read that to see which features got added to Thompson shell.At that time, that site was the largest general-use UNIX complex at Bell Labs, so there were a lot of users.
Note that it was not so much that Bourne sh "won out" over competitors, but that I'd already extended PWB SH about as far as made sense to stay upward compatible, and spent a *lot* of time in discussions with Steve about SH features, and with him and Dennis on relevant OS features, like environment variables, which only solidified in early 1978. Many others were involved in "shell task force" meetings. People were happy to go to something written from scratch (although ALgol 68 wasn't that popular), but didn't want to lose functionality found to be helpful over years of usage.Steve spent a lot of time performance-tuning, and adding features in order to get buyin from the large PWB SH user community.
So, real history:1969- Thompson shell, mostly for terminal use and simple scripts
1975- PWB shell, including variables, more control structures, path search, etc ... stuff needed for widespread use
1977-1978 lots of discussions, I still have some of the memos. The Environment Variable feature didn't settle until early 1978, and UNIX V7 was later.
1978- - C-shell, especially important for interactive featuresJohnMashey (talk)23:34, 25 September 2015 (UTC)[reply]
1979- UNIX V7, with Bourne shell released externally, as best as I can recallJohnMashey (talk)02:42, 30 September 2015 (UTC)[reply]
Is this table really helpful? I'm inclined to toss the whole thing and reduce the whole section to a couple sentences to explain that the behavior of a Unix shell can typically be customized with configuration scripts executed at startup and exit. Before I delete a whole table, possibly making people unhappy, can I hear some comments, please?Msnicki (talk)19:03, 24 October 2015 (UTC)[reply]
Inhttps://en.wikipedia.org/wiki/Unix_shell#Early_shells there is a sentence:
As shell programming became widespread, these external commands were incorporated into the shell itself for performance.
Given the context of that section, the phrase "these external commands" doesn't make sense – I don't think the section mentions external commands anywhere else but this phrase. I know there are some external commands, such asecho, that are external commands, and also built-in shell commands.
MeekMark (talk)14:45, 17 June 2021 (UTC)[reply]
The article says: "A shell hides the details of the underlying operating system..."
This is intuitive, appealing andincorrect as an explanation of the term's origin. Louis Pouzin's 1965 memo[4] was explicit that it was not the operating system (supervisor) "inside" the shell, but rather the procedures that it ran (p. R-3). The purpose of his shell was to create and then communicate with active procedures. That is what Unix shells also do, replacing "active procedure" with "process."— Precedingunsigned comment added by170.41.209.67 (talk)15:54, 26 August 2022 (UTC)[reply]