Solaris shell profiles (bashrc, cshrc, tcshrc)

Here are some profiles (tcshrc/cshrc/bashrc) found on my systems. Source of some of these are comp.unix.solaris,dotfiles.com etc.


TCSH

First the keyboard – the tab key does no autocompletion and the arrow keys cause funny characters on my screen instead of making the cursor > back up or move forward. Backspace and the other keys seem to work OK.

Type the following in:

su -
stty erase ^H
TERM=vt100
export TERM
exec tcsh -l
eval `/usr/openwin/bin/resize -c`

And now you’re ready to work comfortably: TERM is defined properly, [BACKSPACE] key will work, window size is defined, and you can do autocompletion, and MUCH, MUCH more. Why this had to be done, more on that later. But first, let’s configure your SHELL.

Now, type in:

passwd -e

as the new shell, type in “/bin/tcsh”. Your default shell has now been changed to the Tenex C-shell; it can do everything bash can, and then some, AND THEN SOME MORE.

Don’t modify root’s SHELL.

type in “exit”
type in “exit” again, then log in.

Create and edit the following files with your preferred text editor:

~/.login:
stty erase ^H

~/.cshrc:
set Resize=”/usr/openwin/bin/resize”

set autolist
set notify
set correct=cmd
set prompt=”[%B%U%n@%m%b%u][%B%~%b]> “
set savehist=7000

eval “$Resize” -c

setenv TERM vt100
setenv PAGER ‘less -s’

You may also want to edit ~/.logout:
clear

but this is optional.

Anyways, now your cursor keys and the [BACKSPACE] will always work properly, you will have autocompletion (try pressing the [TAB] key on its own!), and everything will just magically work (and better than in bash, too).

The reason you saw ESCape sequences instead of cursor keys moving is that Solaris uses the Bourne SHELL (/bin/sh) as the default. This is the lowest common denominator guaranteed to always work. It is also the standard on all System V, release 4 UNIX operating systems and environments.

Have fun!

Post a Comment

You must bee logged in to post a comment.