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



## Swapjim (Oct 11, 2015)

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?


----------



## tobik@ (Oct 11, 2015)

You are missing this entry in /root/.profile:

```
# 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.


----------



## lme@ (Oct 11, 2015)

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


----------



## Swapjim (Oct 11, 2015)

tobik said:


> You are missing this entry in [...]



Great! That did the trick!



lme@ said:


> 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:


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


----------

