1

From the book Advanced Programming in the Unix environment:

Linux uses the Bourne-again shell for its default shell. In fact,/bin/sh is a link to /bin/bash.The default user shell in FreeBSD and Mac OS X is the TENEX C shell, but they use the Bourne shell for their administrative shell scripts because the C shell’s programming language is notoriously difficult to use.Solaris, having its heritage in both BSD and System V, provides all the shells shown in Figure1.2. Free ports of most of the shells area available on the Internet.

What does the author mean by the term port here and how is it related to shells ?

Geek
  • 6,688
  • I'm quite sure, that the author means that most of the common shells are now also available on those operating systems that differs from the OS, for that the specific shell was originally developed for. The term 'port/porting' is commonly used to describe the transfer of one software to different platforms. – user1146332 Dec 27 '12 at 12:47

1 Answers1

6

That information is a bit outdated and inaccurate. Linux is an operating system kernel, it doesn't have a shell. See how shell and kernel belong to the same image reference.

If by Linux, they mean a Linux distribution, then, they'd need to be more specific. Not all Linux distributions have bash as their sh.

The default user shell in MacOS/X is no longer (since 10.3, 2003) tcsh, but bash now.

I don't think either FreeBSD or MacOS/X ever shipped with the Bourne shell. FreeBSD's sh is a POSIX shell based on the Almquist shell. MacOS/X's one used to be zsh and is now bash built in UNIX compliance mode.

port in this context would refer to a software initially designed for one Operating System that has been adapted (ported) to be able to build on another system. BSDs and MacOS/X (macports) have a packaging system named after that to bundle and include such alien software.

In the context of shells, it doesn't really apply as most shells have been designed from the start as being able to compile on several operating systems. But see dash which was initially a port of NetBSD sh to the GNU/Linux API.

  • Sorry for my poor english. I was refering to the "nut" image with a kernel and a shell. Please feel free to edit and correct my English. – Stéphane Chazelas Dec 27 '12 at 17:27
  • I think your answer will become complete if you can provide that image link in the answer . – Geek Dec 28 '12 at 11:39
  • 2
    To be fair the linked book was published in 1992. That is really early in the development of linux and i'm not sure the modern concept of linux distributions had developed at that point. – plugwash Nov 17 '15 at 04:04
  • @plugwash, there was no MacOS/X until 2001 so that text can't have been written in 1992. It's possible it was written in 2002 or 2003 as MacOS/X's default user shell was tcsh back then. – Stéphane Chazelas Sep 14 '18 at 07:02
  • It seems there were three editions of the book published in 1992, 2005 and 2013. The OP linked the first edition but I guess he must have quoted from a later one. – plugwash Sep 14 '18 at 13:01
  • Afaict in 2005 bash was the de-facto standard shell on all major Linux distributions for both user and scriping purposes. It was only in 2006 that Ubuntu switched to dash. – plugwash Sep 14 '18 at 13:11
  • @plugwash, only for GNU/Linux generic desktop/server distributions (which is probably what the author had in mind when they wrote that text). Most embedded Linux OSes (which represent 99% of Linux-based operating system deployments now, less then, but probably still a majority) would use a ash-based shell if they have a shell at all. – Stéphane Chazelas Sep 14 '18 at 13:17