world leader in high performance signal processing
Trace: » shell

Customizing The Shell Environment

Login shells will automatically read the files /etc/profile and $HOME/.profile when they first run. This allows you to setup the environment of your shell when it first launches.

Launching a Login Shell

To launch a login shell, edit your /etc/inittab file and add a line like:

console::askfirst:-/bin/sh

The key part here is the '-' at the beginning of the path.

Only do this if you have not already turned on the “enable console shell” option for simple init in your vendor/user settings

Example Shell Variables

PS1

This variable allows you to customize the shell prompt (assuming you have fancy shell prompt support enabled). The default value is:

PS1='\u:\w> '

Some other fun values:

  • \u - username
  • \h - hostname
  • $ - # for root, $ for non-root
  • \w - working directory, replace $HOME with '~'
  • \W - working directory
  • \e - ASCII escape \033
  • \[ - start non-printable sequence
  • \] - end non-printable sequence
PATH

Store custom binaries in your own directory and just add it to your PATH:

PATH=$PATH:/usr/local/your/place