Quick Start Guide

18 Bash and Bash Scripts
These days many people use computers with a graphical user interface (GUI) like
KDE or GNOME. Although they oer lots of features, their use is limited when it comes
to the execution of automated tasks. Shells are a good addition to GUIs and this
chapter gives you an overview of some aspects of shells, in this case Bash.
18.1 What is “The Shell”?
Traditionally, the shell is Bash (Bourne again Shell). When this chapter speaks about
“the shell” it means Bash. There are actually more available shells than Bash (ash,
csh, ksh, zsh, …), each employing dierent features and characteristics. If you need
further information about other shells, search for shell in YaST.
18.1.1 Knowing The Bash Conguration Files
A shell can be invoked as an:
1. interactive login shell. This is used when logging in to a machine, invoking Bash
with the --login option or when logging in to a remote machine with SSH.
2. ordinary” interactive shell. This is normally the case when starting xterm, kon-
sole, gnome-terminal or similar tools.
3. non-interactive shell. This is used when invoking a shell script at the commandline.
Depending on which type of shell you use, dierent conguration les are being
read. The following tables show the login and non-login shell conguration les.
Table 18.1: Bash Conguration Files for Login Shells
DescriptionFile
Do not modify this le, otherwise your
modications can be destroyed during
your next update!
/etc/profile
Use this le if you extend /etc/profile/etc/profile.local
Contains system-wide conguration les
for specic programs
/etc/profile.d/
Bash and Bash Scripts 225