Default shell?

grahamperrin

Well-Known Member

Reaction score: 106
Messages: 390

The default shell for root is actually csh(1), not tcsh(1). …
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/linux-users/shells.html is outdated:
… FreeBSD uses tcsh(1) as the default root shell, and the Bourne shell-compatible sh(1) as the default user shell. …
The defaults are now csh(1) for root and tcsh(1) for user, true?

At a glance, is anything else outdated at the page above?

I think it will be useful to have the two defaults mentioned near the head of https://www.freebsd.org/doc/handbook/shells.html
 

JMOR

New Member


Messages: 4

Maybe this is not the proper place for pointing this out. But the following page in the documentation also has the default shells in FreeBSD wrong:


"Instead, FreeBSD uses tcsh(1) as the default root shell, and the Bourne shell-compatible sh(1) as the default user shell"

As it was already mentioned in this thread, the correct information is: csh for root, tcsh for unprivileged users.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,991
Messages: 36,924

/bin/tcsh and /bin/csh are the exact same executable.

The default user shell is whatever you set in /etc/adduser.conf (if that file doesn't exist it defaults to /bin/sh).
 

eldaemon

Active Member

Reaction score: 23
Messages: 141

I've used bash for years and recently shifted to zsh. toor account with say /bin/sh is a good idea.

/bin/sh feels way too light for serious use, /bin/tcsh catches me by surprise a lot.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 10,991
Messages: 36,924

I have set my user's shell to tcsh(1) many years ago. For the sole reason it's part of the base OS so it's always available. I've now grown so accustomed to it I can't do without any more.
 

JMOR

New Member


Messages: 4

The default user shell is whatever you set in /etc/adduser.conf (if that file doesn't exist it defaults to /bin/sh).
You are right, the default shell for a new user is sh (I made a clean install and there is not /etc/adduser.conf by default). I didn't remember I was the one setting tcsh when I created my regular user account (this is my home PC). So, I was wrong when I said " tcsh for unprivileged users", and the documentation is fine there.
I will maintain though that the part of the root shell would have a more accurate wording if it said that the default shell for root is csh (I am pretty sure I was only asked for root's password when installing). Yes, now I know, thanks to you, that they are the same executable. But a newbie like myself who reads that and checks his root's account shell, if he is not aware of this technicality, may think there is a typo in the documentation.

By the way, I finally settled for sh for root (and scripting) and zsh for my regular account (zsh is the one I had when I was using Linux).
 

bsduck

Member

Reaction score: 50
Messages: 85

I'm fine with /bin/sh for my basic usage and prefer it over tcsh. Tried fish but I don't like it, it's too interactive and non-standard to my taste. Bash feels very similar to sh. Zsh looks interesting but I'm somewhat confused by its numerous options, I still have to give it a more serious try.
 

Alain De Vos

Aspiring Daemon

Reaction score: 256
Messages: 984

zsh has all features by default. So it is a simple interactive shell.
For scripts it is flexible.
 

memreflect

Active Member

Reaction score: 173
Messages: 194

For daily use, I personally use shells/rc, though it has its own pitfalls (e.g. variables are globally persistent unless bound to a command and are automatically exported).

When I log in as toor, shells/fish helps me get things done more quickly, but it has too many features for me to use it beyond occasional usage; I leave root's default /bin/csh shell alone.

If you want to stick with familiar sh syntax, many seem happy with shells/bash, shells/zsh, or even one of the ksh variants like shells/ast-ksh.

Of course, after a system upgrade like 12.2-RELEASE→13.0-RELEASE where there's some library incompatibility, the only shells available are sh and tcsh. I use sh on FreeBSD just like I use Internet Explorer on Windows: it's useful enough to let me install the software I actually want to use. 😁
 

rorgoroth

Member

Reaction score: 14
Messages: 23

I've used tcsh for years across bsd and linux and have no plans to change away from it. I do however never use it for scripts and always use dash/sh for those.
 
Top