sh doesn't read /root/.shrc when set as the default root shell

I want to use the classic bourne shell (/bin/sh) but it doesn't read the /root/.shrc file.

I have set a different default EDITOR, PS1, LSCOLORS, but none of those are read (also indicated by set).

I have managed set the classic shell for the normal user of the system and the ~/.shrc file is read.

So, what am I missing?
 
You are missing this entry in /root/.profile:
Code:
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
~/.shrc is not read by default by sh(1). You have to tell sh(1) to read it by setting the ENV variable.

For normal users ~/.profile contains the above snippet by default, root has no such entry.
 
You are missing this entry in [...]

Great! That did the trick!

FYI FreeBSD's /bin/sh is not the Bourne Shell, but based on Almquists ash.

But it clones the functionality of Bourne shell, right?

To be honest, I just tried to do something like:

Code:
file $(which freebsd-update)
And got an error. And then I realized that csh handles things differently. So I had to change my shell.
 
Back
Top