Quick Start Guide:Bash

From Deac Wiki
Jump to navigation Jump to search

bash is the Bourne Again Shell[1] (based on sh, the Bourne shell). It is part of the GNU Project.

Syntax

Here is a brief outline of common syntax issues.

Login/Logout Scripts

The startup files used depend on whether the session is interactive or not, and whether it is a login shell.[2]

  • ~/.bash_profile
  • ~/.bash_login
  • ~/.profile
  • ~/.bashrc
  • ~/.bash_logout

Aliases

The syntax for defining aliases is:

   alias ls='ls -FC --color=auto'
   alias l='ls'
   alias ll='l -l'
   alias la='ll -a'

Environment Variables

The syntax for defining environment variables is:

   export SPECIAL_ENV=some_string_or_other
   export VERY_SPECIAL_ENV=${SPECIAL_ENV}:another_string

See Also

References