multishell user profile

Polytropon freebsd at edvax.de
Wed Apr 21 20:11:36 UTC 2010


On Wed, 21 Apr 2010 09:53:00 +0200, Erik Norgaard <norgaard at locolomo.org> wrote:
> Hi:
> 
> I need to create a user profile that works in different shells, 
> particularly bash, csh and ksh. It seems that these does not read the 
> same files and/or in the same order. So, how do I configure the shell 
> profiles without configuring each shell separately?

You can't - at least not very easily.

Of course, you can do as few shell initialisations per se
if you use things like login.conf to set environment variables
instead of "manually" setting them in the shell config.

The main problem is: The shells you mentioned to use different
formats for their configuration. For example, while you can use

	set promptchars = "%#"
	set prompt = "%n@%m:%~%# "

for your csh, you have to use a different syntax in bash. The
same goes for aliases.

A chance to partially bypass this is to put as many customization
as possible into script-defined commands that you place in ~/bin
(and add this to $PATH).

Of course, this approach doesn't solve all imaginable problems.

As for reading order of configuration files, refer to the
manpages:

	man csh
	man bash
	man ksh

You will see which files are accessed, and in which order, and
where you can put centrally managed profiles as well as user-
specific profiles.



> Also, I can't find information if they use the same syntax, or what 
> syntax they share so I can stick to that.

They don't use the same syntax. Maybe you'll find a good
comparison chart of shell syntax and capabilities. As stupid
as it may sound, you'll find some information here:

	http://en.wikipedia.org/wiki/Comparison_of_command_shells
	http://en.wikipedia.org/wiki/Unix_shell




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list