Talk:Shell script

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

History[edit]

Hello. I came to wikipedia to look for the history of shell scripts. I think they originated in UNIX? Unfortunately, there is no history here. I am sad now. :( Perhaps one of you who knows more, can add history stuff to this page. 93.82.142.95 (talk) 04:30, 19 November 2011 (UTC)[reply]

C shell scripts[edit]

I was unaware that people wrote scripts for C shells. Is it really true? --Yath 08:35, 12 May 2005 (UTC)[reply]

They do, but they shouldn't. --RobHutten 12:36, 27 May 2005 (UTC)[reply]

Book for sale?[edit]

Wondering why one of the external links is to a book that is only for sale. Not in the spirit of Wikipedia if you ask me . . . —Preceding unsigned comment added by 65.119.39.221 (talkcontribs) 19:06, 8 March 2006

Please see Wikipedia:External links for more information. There is no bias against commercial links. The question of adding or not adding a link should be based on relevance and value to the reader of Wikipedia or other downstream sites. -Harmil 19:12, 8 March 2006 (UTC)[reply]
No bookstore links. Besides, there is nothing special about this book distinguishing it from the slew of other books on the subject. The fact that it is only for sale diminishes its value to the reader of Wikipedia. Taking it out. 204.126.229.2 18:43, 22 August 2006 (UTC)[reply]

Referencing an opinionized book?[edit]

If that book is as opinionized as the title says it is, it's more than likely not a very suitable source for wikipedia. Please remove it promptly. —Preceding unsigned comment added by Scratchnloved (talkcontribs) 18:29, 21 February 2008 (UTC)[reply]

rm -rf[edit]

The discussion about "rm -rf * /" is silly. 1) Much more likely this kind of screw-up would occur on command line than in a shell script. 2) Article seems to indicate that rm -rf */ is a reasonable thing to do. It's not. Anyone would know to enter "rm -rf dir_to_remove". 97.126.59.10 (talk) 08:26, 5 August 2011 (UTC)[reply]

There was a fairly recent discussion on one of the *BSD mailing lists asserting that it couldn't happen on "their" system, followed immediately by a comment that pointed out that the code checked only one case. The first instance of user-blunder that I recall being told about (1983) didn't use "/". TEDickey (talk) 08:32, 5 August 2011 (UTC)[reply]

Portability/security/shortcuts?[edit]

Should these scripts be cleaned up to improve portability/security/brevity according to common guidelines? For example:

  • Quote to avoid common bugs even if the scripts change.
  • Use mktemp where necessary to avoid filename collisions.
  • Use the portable /usr/bin/env shellname shebang.
  • Avoid using temporary files if possible, because of the difficulty of handling corner cases properly.

l0b0 (talk) 15:00, 23 October 2012 (UTC)[reply]

Ridiculously technical[edit]

This article is so ridiculously technical it's infuriating. It's definitely not for novices, who know nothing about shell scripts. Encyclopedia articles should be written so that they are clearly understood by everybody. This is like a science manual designed only for scientists. 19:25, 25 August 2013 (UTC)

hmm - your edit history indicates that you spend most of your time watching television. Should we find an educational program which gives content at the level you're looking for? TEDickey (talk) 21:31, 25 August 2013 (UTC)[reply]
Yes, a novice would have a hard time understanding the article. But I think it would be quite difficult to write the article for a novice. To understand about shell scripts, the novice almost has to buy a book or use a tutorial, typing commands into a computer. It seems difficult to convey shell scripting "in the abstract" in a way understandable to a novice. 71.212.102.14 (talk) 02:16, 12 November 2013 (UTC)[reply]

Verisimilitude[edit]

There are no references for the Verisimilitude section. In particular, regarding the word "verisimilitude": is it a term of art, traceable to earlier writing, or is it just colorful phrasing on the part of the Wikipedia editors? — Preceding unsigned comment added by 50.190.174.148 (talk) 22:41, 7 May 2017 (UTC)[reply]

I added the citations requested but I agree "verisimilitude" is a new term for me, too. I can't say how widespread it is but it does appear to be in use, e.g., in this slide deck from France, to capture the idea that shell scripts behave like "real" commands. Msnicki (talk) 00:08, 8 May 2017 (UTC)[reply]
I removed the section because it tried to establish a new term (the slide deck copied from Wikipedia), was overly complicated and overlapped with the Life cycle section. —Dexxor (talk) 06:48, 28 November 2021 (UTC)[reply]

Hatnotes[edit]

There is far too much wording in the hatnote with 4 other links. Which ones are necessary? Can there simply be a section on "Shell scripts on non-POSIX systems"? power~enwiki (π, ν) 00:06, 25 October 2017 (UTC)[reply]

Inaccurate terminokogy re: ssh[edit]

> a Secure Shell (ssh) for SSL telnet connections

This is not true. SSH does not use SSL or TLS but has its own protocol. Nor is it telnet.

Anyway just because rsh and ssh have "sh" or "shell" in the name does not make it a fair comparison to Unix shells. These are glue programs which add network connectivity and invoke another shell. They are not themselves shells. -2601:645:4200:521:882D:99B0:485B:3466 (talk) 14:45, 14 March 2020 (UTC)[reply]

I think the part "a Secure Shell (ssh) for SSL telnet connections," does not belong to this article and it should be removed. Fedkad (talk) 13:04, 15 August 2021 (UTC)[reply]

Verisimilitude and Life cycle overlap[edit]

The mentioned sections both address filename extensions and implementation encapsulation. I propose to delete the Verisimilitude section because it is harder to understand and the section title itself is unusual, see #Verisimilitude. —Dexxor (talk) 14:13, 24 July 2020 (UTC)[reply]

Agreed. E.g., the section title (a joke title?) is disconnected from the content. The content is also too long - it could be said in far fewer words. Perhaps the whole section is a joke section?
verisimilitude - "1. the property of seeming true, of resembling reality; resemblance to reality, realism. 2. a statement which merely appears to be true"
--Mortense (talk) 13:26, 27 November 2021 (UTC)[reply]
I removed the section. —Dexxor (talk) 06:48, 28 November 2021 (UTC)[reply]

History - serious shell scripting usage at Bell Labs started in 1975 with PWB shell[edit]

While of course I may be biased, if people are updating this, it would be worth checking PWB shell, which describes the history. It started with the Thompson shell, added more control structures, simple shell variables, including $p (search path, ancestor of $PATH), $s (start directory, ancestor of $HOME), the ability to just type command and if command was marked executable, but wasn't a binary executable, invoked the shell, onintr for trapping interrupts for cleanupm etc ... and other features whose analogs appared in Bourne shell. Bell Labs Piscataway's PWB/UNIX computer center supported ~1000 programmers working on software for mainframes, but using UNIX systems for editing source code and documentation and scripting to automate their work. Around 1976 it likely had more shell scripts than the rest of Bell Labs put together. The control stucture commands were moved into the shell itself for speed, because of heaby usage. The shell variables were the ancestors of the environment variable addition to 7 Edition that Steve Bourne, Dennis Ritchie and I concocted as a more general mechanism.JohnMashey (talk) — Preceding undated comment added 02:21, 26 June 2021 (UTC)[reply]

Supply missing quote citation[edit]

In the Advantages and Disadvantages section, there is a quote with a missing citation:

>Larry Wall, creator of Perl, famously wrote that "It is easier to port a shell than a shell script."[This quote needs a citation]

I attempted to edit the page to provide the citation directly but I did not understand the correct citation syntax. Below is the citation for this quote if someone else would like to perform the edit correctly. It comes from the `comp.unix.shell` Usenet archives and can be found at two different URLs:

---

Fri Jan 4 10:55:21 AEST 1991

In article <2577 at wn1.sci.kun.nl> hansm at cs.kun.nl (Hans Mulder) writes:

I think the latter behaviour is more useful. For one thing, it makes
"if foo | grep -s bar" work right 100% of the time.

Presuming, of course, that your grep actually returns a reasonable exit status. Some don't, alas.

And the moral of the story? It's easier to port a shell than a shell script.

Larry Wall lwall at jpl-devvax.jpl.nasa.gov Jstangroome (talk) 05:44, 5 January 2023 (UTC)[reply]