Programming with Bourne or C shell

Giorgos Keramidas keramida at
Mon Jan 3 15:44:05 PST 2005

On 2004-12-31 21:20, Michael Madden <madden at> wrote:
> I have most of my interactive shell experience using bash on Linux and
> shell programing on Unix-like systems with Bourne shell.  Since
> FreeBSD's default shell is csh/tcsh, I was wondering if it's still
> considered an atrocity to develop shell scripts with C shell:


There is no good reason to use csh for batch shell scripts.  On the
contrary, as the URL quoted notes, there are many reasons why you
shouldn't :-)

> Are most FreeBSD users still using csh or tcsh has their interactive
> shell and sh for programming?  I think it would be nice to use the
> same interactive and programming shell for consistency.

I use sh(1) for shell scripting.  Being able to write sh-like mini
scripts on the command line, as the need arises, like:

	$ for fname in * ; do lname=`echo $fname | tr A-Z a-z` ;
	    mv -i "${fname}" "${lname}" ; done

is also a nice thing, so I mostly use bash for interactive stuff.

- Giorgos

More information about the freebsd-questions mailing list