0% found this document useful (0 votes)
87 views

Bash Shell Scripts: Cecilia M. Curlango Rosas

Shell scripts allow users to automate tasks by writing programs in the Bash shell programming language. A shell is a program that reads command line input and executes commands, and also provides scripting capabilities. Popular shells include Bash, Bourne, C shell, and Z shell. Shell scripts are useful for system administration tasks like backups and log file monitoring, as well as installing and configuring programs.

Uploaded by

Yosef Galaviz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Bash Shell Scripts: Cecilia M. Curlango Rosas

Shell scripts allow users to automate tasks by writing programs in the Bash shell programming language. A shell is a program that reads command line input and executes commands, and also provides scripting capabilities. Popular shells include Bash, Bourne, C shell, and Z shell. Shell scripts are useful for system administration tasks like backups and log file monitoring, as well as installing and configuring programs.

Uploaded by

Yosef Galaviz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Bash Shell scripts

Cecilia M. Curlango Rosas

1
Main Topics

• What are shells?

• What are scripts?

• What are scripts used for?

2
Image: http://flylib.com/books/en/2.872.1.85/1/

3
What is a shell?
• A shell is a program that reads the command line
and executes the commands the user writes.

• A shell also lets you do tasks like control programs,


redirect input and output and provides a language
for writing scripts.

• On a Linux system, the user can select what shell


he wants for his system.

4
Why learn to use the shell?

http://linuxcommand.org/learning_the_shell.php
5
What shells are there?

• The Bourne shell was one of


the most important shells used
in the first Unix versions.

• Stephen R. Bourne from Bell


Labs wrote it.

6
What shells are there?

• All Unix type systems have at least one shell that is


compatible with the Bourne shell.

• The name of the program for this shell is sh.

• Its default prompt is $.

7
What shells are there?
• The C shell was developed by
Bill Joy for Berkeley Software
Distribution (BSD).

• Its syntax is similar to the C


programming language.

• It is used mostly for interacting


with the terminal, not for
writing scripts.

8
What shells are there?
Derived from Bourne Shell Derived from C shell Others

Almquist shell (ash) TENEX C shell (tcsh) wish (Tcl/Tk)

Bourne-Again shell (bash) Hamilton C shell scsh (Scheme)

Debian Almquist shell (dash)

Korn shell (ksh)

Public domain Korn shell (pdksh)

MirBSD Korn shell (mksh)

Z shell (zsh)

9
Shells

Image from: http://www.ibm.com/developerworks/library/l-linux-shells/

10
Shell Configuration Files

11
http://en.wikipedia.org/wiki/Unix_shell
Shell Architecture

Image from: http://www.ibm.com/developerworks/library/l-linux-shells/

Cecilia Curlango Rosas


12
What is a script?
• A script is a file that has executable commands
that make up a program.

• In this course, all these terms will mean the same


thing: Bash shell script, Bash script, shell script
and script.

• A Bash shell script is a program written in the Bash


programming language.

13
What are scripts used for?

• Administrative system tasks like: disk backups and


checking log files.

• Interactive tasks

• Install and configure programs

14
References

• Bash programming HOW-TO http://tldp.org/


HOWTO/Bash-Prog-Intro-HOWTO.html

• Wiki book Bash scripting http://en.wikibooks.org/


wiki/Bash_Shell_Scripting

15

You might also like