# why csh?



## fluca1978 (Oct 3, 2011)

Hi all,
I'm just curious why FreeBSD is using csh as the shell for root. Is there any historical reason or are there technical ones?


----------



## SirDice (Oct 3, 2011)

As far as I know it's historical. Also note that for instance bash is GPL'ed and can therefor never be part of the base OS.


----------



## ramonovski (Oct 3, 2011)

So each "component" of the FreeBSD base is/must be under BSD license?

</noob>


----------



## wblock@ (Oct 3, 2011)

That's the goal, but it's not there yet.  clang will be a big jump towards it.


----------



## YZMSQ (Oct 3, 2011)

ramonovski said:
			
		

> So each "component" of the FreeBSD base is/must be under BSD license?
> 
> </noob>


Not yet, but will be.


----------



## fluca1978 (Oct 4, 2011)

SirDice said:
			
		

> As far as I know it's historical. Also note that for instance bash is GPL'ed and can therefor never be part of the base OS.



Yes I know about the license issue, I was just thinking about a Bourne shell.


----------



## SirDice (Oct 4, 2011)

The 'classic' bourne shell is good for scripting but using it interactively is a royal pain in the butt. The C-Shells are a pain to script but are good for interactive use.


----------



## fluca1978 (Oct 4, 2011)

Sorry, I don't understand why c-shell is better than bourne for interactive use. Can you elaborate a bit more? I'm just curious...


----------



## SirDice (Oct 4, 2011)

Tab-completion, history and a few other things. Just set your shell to /bin/sh for a while then switch to /bin/tcsh. You'll notice the differences soon enough


----------



## Beastie (Oct 4, 2011)

csh is a great interactive shell and ash is great for scripting. Virtually anything else has a dependency bloat/larger memory footprint or is license-incompatible.


----------



## UNIXgod (Oct 5, 2011)

fluca1978 said:
			
		

> Sorry, I don't understand why c-shell is better than bourne for interactive use. Can you elaborate a bit more? I'm just curious...



In the late 70's Bill Joy made the first distro at Berkeley( i.e. BSD1)

He endowed bell labs unix with ex, vi, and csh. Patches where sent back and forth. One could almost state that he also was the first system admin. Joy's csh had interactive features the thompson shell and bourne shell did not have. As it's been mentioned shell history and tab complete was one of them. I am not sure if external commands where internalized at the time but bourne was all external at first (i.e. while, if where programs in /sbin and [ and test where actual hard links.)

Since ksh, zsh and even bash are posix compliant shells you can install those through ports if you prefer not to use csh or ash. In fact from a earlier thread it would be my observation that most people install one of these shells as their user, use (t)csh on the system as root and write scripts to utilize Almquist's Bourne shell.

Also older users that started off with it will prefer csh for their users and there are a couple threads on usage and customization for user level on this forum.

I hope my information is helpful. I'm a hack historian when it comes to BSD.


----------

