The closest thing to the Bourne shell, which wasn't really an open source program and cannot be found on pretty much any operating system nowadays, is the Heirloom Bourne shell from OpenSolaris, which is shells/heirloom-sh
in the FreeBSD ports collection (usually installed under /usr/ports
).
Note that this is not sh
.
That is (a slightly altered version of) the Debian Almquist shell on FreeBSD.
The Heirloom Bourne shell installs as jsh
.
This has no dealing with ~/.shrc
.
It only sources ~/.profile
, and that only when it is invoked as a login shell.
The only other file that it sources is /etc/profile
.
The Bourne shell didn't have all of these complexities that grew up later, with lots of different files.
Ironically, it was the C shell, originally a BSD favourite, that kickstarted the trend of all of these other rc files.
The Heirloom Bourne shell isn't quite the Bourne shell.
It has job control commands, for instance; which the Bourne shell didn't have because it was written for an operating system that had no such thing.
Some of the changes that happened in the history of OpenSolaris mean that this isn't the original Bourne shell.
As I said, one cannot get that for any operating system nowadays; and even on the commercial Unices one would have got updated versions of the Bourne shell from roughly the late 1980s onwards, adding in new System 5 Release 4 stuff, just like this one.
So why do you have a ~/.shrc
claiming that it's for the Bourne shell and pointing to the sh(1) manual page in a comment?
Basically, that comment is a lie.
sh
on FreeBSD and NetBSD is the Almquist shell, FreeBSD using a lightly altered version of the Debian Almquist shell, which was in turn a light alteration of the NetBSD Almquist shell done by Debian people at the turn of the 21st century.
If you look at the sh(1) manual, it tells you that it is the shell written by Kenneth Almquist, not the shell written by Stephen R. Bourne.
If you want to try out the Bourne shell, then running sh
on FreeBSD will not help you one bit.
That manual also tells you how to manually set up your ~/.profile
so that interactive Almquist shells source a ~/.shrc
file.
This doesn't happen by default in the Almquist shell, where ~/.shrc
isn't a standard thing.
~/.shrc
is just a conventional file that got dumped into your home directory from /usr/share/skel/
when your home directory was created by pw useradd
.
It doesn't actually do anything for any shell as standard.
If you want to try out something really esoteric, more so even than the Heirloom Bourne shell, FreeBSD even has the Thompson shell available, as shells/osh
in ports.
On the gripping hand, I can recommend trying out and learning the Almquist shell over (or at least before) trying out and learning the Heirloom Bourne shell.
It's a lot more useful to know, as all of the #!/bin/sh
scripts on FreeBSD of course use it.
The Watanabe shell, shells/yash
in ports, is another one worthwhile experiencing.
The Watanabe and Debian Almquist shells give the closest tastes of what having only the POSIX-conformant subset of shell behaviours is like, albeit that they both have the non-standard emacs
command line editing mode. ☺
shells/heirloom-sh
in ports. "bash" is the Bourne Again shell. Please pick one tag and the correct name for what you want. Answers are not the same for the two shells. – JdeBP May 28 '23 at 08:11.shrc
on FreeBSD. But the questioner has written that xe wants to try the Bourne shell, which one can come close to doing on FreeBSD, and used the [tag:bourne-shell] tag. Taking the questioner at xyr word, and ignoring the self-contradictory [tag:bash] tag, it's actually a different answer entirely. Hence the need for clarification of this poorly worded and ambiguous question. – JdeBP May 28 '23 at 08:22