Revision as of 16:52, 8 April 2013 editMsnicki (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers10,358 edits Replace broken link for the Software QA Magazine article that's disappeared from the web with a link to a snapshot at archive.org.← Previous edit | Latest revision as of 13:46, 15 February 2022 edit undoMsnicki (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers10,358 edits Undid revision 1071894190 by 178.138.98.98 (talk) Unnecessary per MOS:DEADNAMETag: Undo | ||
(90 intermediate revisions by 37 users not shown) | |||
Line 2: | Line 2: | ||
| name = Hamilton C shell | | name = Hamilton C shell | ||
| logo = | | logo = | ||
| screenshot = |
| screenshot = Hamilton C shell x64 on Windows 7.png | ||
| screenshot size = 300px | |||
| caption = 64-bit Hamilton C shell on a Windows 7 desktop. | | caption = 64-bit Hamilton C shell on a Windows 7 desktop. | ||
| collapsible = | | collapsible = | ||
| author = Nicole Hamilton | | author = Nicole Hamilton | ||
| developer = | | developer = | ||
| released = {{Start date |
| released = {{Start date and age|1988|12|12}} | ||
| discontinued = | | discontinued = | ||
| latest release version = 5. |
| latest release version = 5.2.g | ||
| latest release date = {{Start date and age| |
| latest release date = {{Start date and age|2017|03|05}} | ||
| latest preview version = | | latest preview version = | ||
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD}} --> | | latest preview date = <!-- {{Start date and age|YYYY|MM|DD}} --> | ||
| frequently updated = | |||
| programming language = ] | | programming language = ] | ||
| operating system = ] | | operating system = ] (historically ]) | ||
| engine = | |||
| platform = | | platform = | ||
| size = | | size = | ||
| language = | | language = | ||
| status = | |||
| genre = ] on ] | | genre = ] on ] | ||
| license = |
| license = ] ] | ||
| website = |
| website = {{URL|https://hamiltonlabs.com/Cshell.htm}} | ||
}} | }} | ||
Line 30: | Line 28: | ||
| title = Hamilton C shell Quick Reference | | title = Hamilton C shell Quick Reference | ||
| publisher = Hamilton Laboratories, Wayland, MA | | publisher = Hamilton Laboratories, Wayland, MA | ||
| date = Jul 10 1990 | | date = Jul 10, 1990 | ||
| url = |
| url = https://hamiltonlabs.com/Archives/1990-07-10-Hamilton-C-shell-Quick-Reference.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref><ref name=SoftwareQA> | </ref><ref name=SoftwareQA> | ||
{{cite journal|last=Faught |first=Danny |title=The shell game |journal=Software QA Magazine |volume=3 |number=4 |date=Aug 31, 1996 |url=http://tejasconsulting.com/sqamag/shell.html |access-date=Apr 8, 2013 |url-status=dead |archive-url=https://web.archive.org/web/20120301104503/http://tejasconsulting.com/sqamag/shell.html |archive-date=March 1, 2012 }} | |||
⚫ | {{cite |
||
⚫ | </ref> for ] created by Nicole Hamilton<ref>The author has discussed her transition from Douglas Hamilton on a panel discussion at Stanford, beginning at 29:37. {{cite AV media | ||
| last = Faught | |||
| first = Danny | |||
| title = The shell game | |||
| journal = Software QA Magazine | |||
| volume = 3 | |||
| number = 4 | |||
| date = Aug 31 1996 | |||
| url = http://web.archive.org/web/20120301104503/http://tejasconsulting.com/sqamag/shell.html | |||
| accessdate = Apr 8 2013 | |||
⚫ | }} | ||
⚫ | </ref> for ] created by Nicole Hamilton<ref>The author has discussed her transition from Douglas Hamilton on a panel discussion at Stanford, beginning at 29:37. {{cite |
||
| people = Nicole Hamilton, Carl Ingram, Liz Kennedy Myers, Tom Mills, John Ordway, Scott Thatcher, Kirstie Wilde (Moderator) | | people = Nicole Hamilton, Carl Ingram, Liz Kennedy Myers, Tom Mills, John Ordway, Scott Thatcher, Kirstie Wilde (Moderator) | ||
| title = Class of 1972 Panel Discussion: Hell No We Won't Go (Quietly Into the Night)! | | title = Class of 1972 Panel Discussion: Hell No We Won't Go (Quietly Into the Night)! | ||
| publisher = Stanford Alumni Association, iTunes U | | publisher = Stanford Alumni Association, iTunes U | ||
| date = Nov 28 2007 | | date = Nov 28, 2007 | ||
| url = |
| url = https://itunes.apple.com/us/podcast/class-1972-panel-discussion/id385582534?i=85423311 | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref> at Hamilton Laboratories. It was first released on ] on December 12, 1988<ref name=MiddlesexNews> | </ref> at Hamilton Laboratories as a completely original work, not based on any prior code. It was first released on ] on December 12, 1988<ref name=MiddlesexNews> | ||
{{cite journal | {{cite journal | ||
| last = Machlis | | last = Machlis | ||
Line 62: | Line 50: | ||
| issue = Dec 18 1988 | | issue = Dec 18 1988 | ||
| pages = 2E | | pages = 2E | ||
| url = |
| url = https://hamiltonlabs.com/Archives/Wayland-writer-for-IBM-Sharon-Machlis-Middlesex-News-Dec-18-1988.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref><ref name=PCWeek> | </ref><ref name=PCWeek> | ||
Line 71: | Line 59: | ||
| title = Hamilton C Shell Speeds Development Of OS/2 Applications | | title = Hamilton C Shell Speeds Development Of OS/2 Applications | ||
| journal = PC Week | | journal = PC Week | ||
| issue = Dec 26 1988 |
| issue = Dec 26 1988 – Jan 2 1989 | ||
| pages = 37 | | pages = 37 | ||
| url = |
| url = https://hamiltonlabs.com/Archives/Hamilton-C-Shell-Speeds-Development-of-OS-2-Applications-Ann-Sussman-PC-Week-Dec-26-1988.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref><ref name=Announce> | </ref><ref name=Announce> | ||
Line 84: | Line 72: | ||
| issue = Summer 1989 | | issue = Summer 1989 | ||
| pages = 119–121 | | pages = 119–121 | ||
| url = |
| url = https://hamiltonlabs.com/Archives/Hamilton-C-Shell-Announcement-Douglas-A-Hamilton-IBM-Personal-Systems-Developer-Summer-1989.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref><ref name=DrDobbs>{{Cite journal | </ref><ref name=DrDobbs>{{Cite journal | ||
Line 93: | Line 81: | ||
| journal = Dr. Dobb's Journal | | journal = Dr. Dobb's Journal | ||
| date = Jan 1991 | | date = Jan 1991 | ||
| url = |
| url = https://hamiltonlabs.com/Archives/Examining-the-Hamilton-C-Shell-Scott-Richman-Dr-Dobbs-Journal-Jan-1991.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref><ref name=MIPS> | </ref><ref name=MIPS> | ||
Line 103: | Line 91: | ||
| journal = MIPS Magazine | | journal = MIPS Magazine | ||
| issue = Sep 1989 | | issue = Sep 1989 | ||
| url = |
| url = https://hamiltonlabs.com/Archives/The-Hamilton-C-shell-Kenneth-G-Goutal-MIPS-Magazine-Sep-1989.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref><ref name=BYTE> | </ref><ref name=BYTE> | ||
Line 113: | Line 101: | ||
| journal = BYTE Magazine | | journal = BYTE Magazine | ||
| issue = Feb 1990 | | issue = Feb 1990 | ||
| url = |
| url = https://hamiltonlabs.com/Archives/OS-2-Unix-Style-Tom-Yager-BYTE-Magazine-Feb-1990.pdf | ||
| |
| access-date = July 28, 2016 | ||
}} | }} | ||
</ref> and on ] in July 1992.<ref>, retrieved |
</ref> and on ] in July 1992.<ref>, retrieved July 28, 2016.</ref><ref> | ||
{{Cite newsgroup | {{Cite newsgroup | ||
| author = Hamilton, Doug | | author = Hamilton, Doug | ||
| title = Looking for C-Shell on NT | | title = Looking for C-Shell on NT | ||
| date = Jul 27 1995 | | date = Jul 27, 1995 | ||
| newsgroup = comp.os.ms-windows.nt.misc | | newsgroup = comp.os.ms-windows.nt.misc | ||
| |
|message-id= hamilton.806823765@BIX.com | ||
| url = |
| url = https://groups.google.com/group/comp.os.ms-windows.nt.misc/msg/66c8c99074f5b29a?hl=en | ||
| |
| access-date = Oct 8, 2010 | ||
}}</ref><ref> | }}</ref><ref> | ||
{{cite journal | {{cite journal | ||
Line 130: | Line 118: | ||
| first = Michael P. | | first = Michael P. | ||
| title = Hamilton C Shell | | title = Hamilton C Shell | ||
| journal = Windows IT |
| journal = Windows IT Pro | ||
| date = |
| date = March 31, 1998 | ||
| url = |
| url = https://www.itprotoday.com/windows-78/hamilton-c-shell | ||
| |
| access-date = September 22, 2019 | ||
}} | }} | ||
</ref> The OS/2 version was discontinued in 2003 but the Windows version continues to be actively supported. | </ref> The OS/2 version was discontinued in 2003 but the Windows version continues to be actively supported. | ||
Line 139: | Line 127: | ||
== Design == | == Design == | ||
Hamilton C shell differs from the Unix C shell in several respects |
Hamilton C shell differs from the Unix C shell in several respects. These include its ] architecture, its use of ], and the decision to follow Windows rather than Unix conventions.<ref name=MIPS/><ref name=BYTE/> | ||
=== |
=== Parser === | ||
] ] on ], showing the use of ] for factoring.]] | ] ] on ], showing the use of ] for factoring.]] | ||
The original C shell |
The original C shell uses an ad hoc parser. This has led to complaints about its limitations. It works well enough for the kinds of things users type interactively but not very well for the more complex commands a user might take time to write in a script. It is not possible, for example, to pipe the output of a ] statement into ]. There was a limit to how complex a command it could handle.<ref name=harm> by Tom Christiansen</ref> | ||
By contrast, Hamilton uses a top-down ] that allows it to compile |
By contrast, Hamilton uses a top-down ] that allows it to compile statements to an internal form before running them.<ref name=EarlyQuickRef/><ref name=MIPS/> As a result, statements can be nested or piped arbitrarily.<ref name=Announce/> The language has also been extended with built-in and user-defined procedures, local variables, floating point and additional expression, editing and wildcarding operators, including an "indefinite directory" wildcard construct written as "<code>...</code>" that matches zero or more directory levels as required to make the rest of the pattern match.<ref> | ||
⚫ | {{cite web | ||
| title = Wildcarding and pattern matching | |||
| publisher = Hamilton Laboratories | |||
⚫ | | url = https://hamiltonlabs.com/UserGuide/31-Wildcarding.htm | ||
| access-date = August 13, 2018 | |||
⚫ | }} | ||
⚫ | </ref> | ||
=== Threads === | === Threads === | ||
Line 153: | Line 148: | ||
] ] date loops.]] | ] ] date loops.]] | ||
⚫ | Lacking ] or a high performance way to recreate that functionality, Hamilton uses the Windows ] facilities instead.<ref name=Announce/><ref name=MIPS/> When a new thread is created, it runs within the same process space and it shares all of the process state. If one thread changes the current directory or the contents of memory, it's changed for all the threads. It's much cheaper to create a thread than a process but there's no isolation between them. To recreate the missing isolation of separate processes, the threads cooperate to share resources using ].<ref> | ||
The Unix C shell supports ] and ].<ref name=Announce/> A subshell is a separate ] copy of the shell that inherits the current state but can then make changes, e.g., to the current directory, without affecting the parent. When the Unix C shell runs a script, it runs it in a subshell. A subshell can also be specified by putting parentheses around a group of statements. Concurrency occurs in pipelines, where all the stages are intended to run concurrently, or when a command is run in the ]. | |||
The Unix C shell's implementation of both these features depends on being able to make copies of its entire ] very inexpensively, which in turn depends on the Unix ] system call, which has access to the hardware. The ] of fork are that it creates a ] which is a duplicate of the caller, differing only in the return value from fork. The parent and child are otherwise identical with duplicate sets of open ]s, duplicate ] and duplicate memory images. The memory image, which can be quite large, is duplicated using the hardware ] and a technique called "]": Initially, parent and child share the same physical pages in memory but all the pages are marked read-only. When one or the other tries to write to a page, a hardware ] is raised and the Unix ] makes a copy of the page, gives the original to one process and the copy to the other and marks them both writable. | |||
But Windows doesn't support a fork primitive under its native ] (even though it is supported in the kernel for the POSIX subsystem), in part because Windows was conceived as graphical OS and it was unclear what it would mean to fork a graphical application with ]s.<ref> | |||
{{Cite newsgroup | |||
| author = Hamilton, Douglas A. | |||
| title = Why doesn't OS/2 have fork()? | |||
| date = Jan 9 1997 | |||
| newsgroup = comp.os.os2.programmer.misc | |||
| url = http://groups.google.com/group/comp.os.os2.programmer.misc/msg/b7d9bd14f38adef9?hl=en& | |||
| accessdate = Oct 8 2010 | |||
}} | |||
</ref> It's possible to simulate the functionality of fork on Windows at the ], but without access to the hardware page tables, it's awkward and not nearly as performant.<ref> | |||
{{Cite newsgroup | |||
| author = Hamilton, Doug | |||
| title = fork() on NT! or info on porting Unix apps to NT | |||
| date = Feb 6 1994 | |||
| newsgroup = comp.os.ms-windows.nt.misc | |||
| url = http://groups.google.com/group/comp.os.ms-windows.nt.misc/msg/121f76f77cf137c0?hl=en& | |||
| accessdate = Oct 8 2010 | |||
}} | |||
</ref><ref> | |||
{{cite web | |||
| title = Cygwin FAQ: How is fork() implemented? | |||
| url = http://cygwin.com/faq/faq-nochunks.html#faq.api.fork | |||
| accessdate = Oct 10 2010 | |||
}} | |||
</ref><ref> | |||
{{cite web | |||
| title = Highlights of Cygwin Functionality: Process Creation | |||
| url = http://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process | |||
| accessdate = Oct 10 2010 | |||
}} | |||
</ref><ref> | |||
{{Cite mailing list | |||
| last = Blake | |||
| first = Eric | |||
| title = Bash doesn't launch the applications directly | |||
| mailinglist = Cygwin project | |||
| date = Jan 15 2009 | |||
| url = http://www.cygwin.com/ml/cygwin/2009-01/msg00461.html | |||
| accessdate = Oct 10 2010 | |||
}} | |||
⚫ | </ref> | ||
⚫ | Lacking fork or a |
||
{{Cite newsgroup | {{Cite newsgroup | ||
| author = Hamilton, Doug | | author = Hamilton, Doug | ||
| title = Suggestions for multiple-reader/single-writer lock? | | title = Suggestions for multiple-reader/single-writer lock? | ||
| date = Apr 21 1995 | | date = Apr 21, 1995 | ||
| newsgroup = comp.os.ms-windows.nt.misc | | newsgroup = comp.os.ms-windows.nt.misc | ||
| |
|message-id= hamilton.798430053@BIX.com | ||
| url = |
| url = https://groups.google.com/group/comp.os.ms-windows.programmer.win32/msg/77533bcc6197c627?hl=en | ||
| |
| access-date = July 28, 2016 | ||
}}</ref> | }}</ref> | ||
=== Windows |
=== Windows conventions === | ||
⚫ | Hamilton differs from other Unix shells in that it also directly supports Windows conventions for ], ], ]s, etc.<ref name=BYTE/> | ||
⚫ | |||
== References == | == References == | ||
{{Reflist|30em}} | |||
{{reflist}} | |||
== External links == | == External links == | ||
⚫ | * {{Official website|https://hamiltonlabs.com/Cshell.htm}} | ||
* | |||
⚫ | {{Unix shells}} | ||
⚫ | * |
||
⚫ | |||
⚫ | {{Unix |
||
] | ] | ||
] | |||
] | |||
] | ] | ||
] | ] | ||
] | ] | ||
] | ] | ||
] | ] | ||
] | |||
] | ] | ||
] |
Latest revision as of 13:46, 15 February 2022
64-bit Hamilton C shell on a Windows 7 desktop. | |
Original author(s) | Nicole Hamilton |
---|---|
Initial release | December 12, 1988; 36 years ago (1988-12-12) |
Stable release | 5.2.g / March 5, 2017; 7 years ago (2017-03-05) |
Written in | C |
Operating system | Windows (historically OS/2) |
Type | Unix Shell on Windows |
License | Commercial proprietary software |
Website | hamiltonlabs |
Hamilton C shell is a clone of the Unix C shell and utilities for Microsoft Windows created by Nicole Hamilton at Hamilton Laboratories as a completely original work, not based on any prior code. It was first released on OS/2 on December 12, 1988 and on Windows NT in July 1992. The OS/2 version was discontinued in 2003 but the Windows version continues to be actively supported.
Design
Hamilton C shell differs from the Unix C shell in several respects. These include its compiler architecture, its use of threads, and the decision to follow Windows rather than Unix conventions.
Parser
The original C shell uses an ad hoc parser. This has led to complaints about its limitations. It works well enough for the kinds of things users type interactively but not very well for the more complex commands a user might take time to write in a script. It is not possible, for example, to pipe the output of a foreach statement into grep. There was a limit to how complex a command it could handle.
By contrast, Hamilton uses a top-down recursive descent parser that allows it to compile statements to an internal form before running them. As a result, statements can be nested or piped arbitrarily. The language has also been extended with built-in and user-defined procedures, local variables, floating point and additional expression, editing and wildcarding operators, including an "indefinite directory" wildcard construct written as "...
" that matches zero or more directory levels as required to make the rest of the pattern match.
Threads
Lacking fork or a high performance way to recreate that functionality, Hamilton uses the Windows threads facilities instead. When a new thread is created, it runs within the same process space and it shares all of the process state. If one thread changes the current directory or the contents of memory, it's changed for all the threads. It's much cheaper to create a thread than a process but there's no isolation between them. To recreate the missing isolation of separate processes, the threads cooperate to share resources using locks.
Windows conventions
Hamilton differs from other Unix shells in that it also directly supports Windows conventions for drive letters, filename slashes, escape characters, etc.
References
- ^ Early Hamilton C shell Quick Reference (PDF). Hamilton Laboratories, Wayland, MA. Jul 10, 1990. Retrieved July 28, 2016.
- Faught, Danny (Aug 31, 1996). "The shell game". Software QA Magazine. 3 (4). Archived from the original on March 1, 2012. Retrieved Apr 8, 2013.
- The author has discussed her transition from Douglas Hamilton on a panel discussion at Stanford, beginning at 29:37. Nicole Hamilton, Carl Ingram, Liz Kennedy Myers, Tom Mills, John Ordway, Scott Thatcher, Kirstie Wilde (Moderator) (Nov 28, 2007). Class of 1972 Panel Discussion: Hell No We Won't Go (Quietly Into the Night)!. Stanford Alumni Association, iTunes U. Retrieved July 28, 2016.
- Machlis, Sharon. "Wayland writer for IBM" (PDF). Middlesex News (Dec 18 1988): 2E. Retrieved July 28, 2016.
- Sussman, Ann. "Hamilton C Shell Speeds Development Of OS/2 Applications" (PDF). PC Week (Dec 26 1988 – Jan 2 1989): 37. Retrieved July 28, 2016.
- ^ Hamilton, Douglas A. "Hamilton C shell Announcement" (PDF). IBM Personal Systems Developer (Summer 1989): 119–121. Retrieved July 28, 2016.
- Richman, Scott (Jan 1991). "Examining the Hamilton C Shell" (PDF). Dr. Dobb's Journal. Retrieved July 28, 2016.
- ^ Goutal, Kenneth G. "The Hamilton C shell" (PDF). MIPS Magazine (Sep 1989). Retrieved July 28, 2016.
- ^ Yager, Tom. "OS/2, Unix Style" (PDF). BYTE Magazine (Feb 1990). Retrieved July 28, 2016.
- Hamilton C shell for Windows Release Notes 4.0, retrieved July 28, 2016.
- Hamilton, Doug (Jul 27, 1995). "Looking for C-Shell on NT". Newsgroup: comp.os.ms-windows.nt.misc. Usenet: hamilton.806823765@BIX.com. Retrieved Oct 8, 2010.
- Deignan, Michael P. (March 31, 1998). "Hamilton C Shell". Windows IT Pro. Retrieved September 22, 2019.
- Csh Programming Considered Harmful by Tom Christiansen
- "Wildcarding and pattern matching". Hamilton Laboratories. Retrieved August 13, 2018.
- Hamilton, Doug (Apr 21, 1995). "Suggestions for multiple-reader/single-writer lock?". Newsgroup: comp.os.ms-windows.nt.misc. Usenet: hamilton.798430053@BIX.com. Retrieved July 28, 2016.
External links
Unix shells | |
---|---|