0% found this document useful (0 votes)
35 views1 page

The Shell Scripting Tutorial

The Shell Scripting Tutorial by Steve Parker aims to introduce the basics of shell script programming, focusing on the Bourne shell and its capabilities. It is designed for individuals with some prior experience in Unix/Linux and programming, providing practical examples and exercises. The tutorial is available in PDF format for purchase and has been peer-reviewed by a large audience, making it a popular resource for learners and educators alike.

Uploaded by

timyub2010
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)
35 views1 page

The Shell Scripting Tutorial

The Shell Scripting Tutorial by Steve Parker aims to introduce the basics of shell script programming, focusing on the Bourne shell and its capabilities. It is designed for individuals with some prior experience in Unix/Linux and programming, providing practical examples and exercises. The tutorial is available in PDF format for purchase and has been peer-reviewed by a large audience, making it a popular resource for learners and educators alike.

Uploaded by

timyub2010
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/ 1

Split Software

Download Free O'Reilly OPEN


eBook

Shell
Shell Scripting
Scripting
Tutorial
Tutorial

The
The Linux
Linux Shell
Shell
Scripting
Scripting
Tutorial
Tutorial

"

Shell Scripting
Tutorial

Share

IQ Test: What Is Your IQ?

Answer 20 questions to !nd out!

Brainable IQ Test

Open

Shell Scripting Tutorial


By Parker, Steve (Paperback)

$7.99
Buy Now
Rated 4.3 out of 5

Buy this Shell Scripting Tutorial as a

PDF for only $5

1. Introduction

Purpose Of This
Tutorial
This tutorial is written to help people
understand some of the basics of
shell script programming (aka shell
scripting
scripting), and hopefully to
introduce some of the possibilities of
simple but powerful programming
available under the Bourne shell. As
such, it has been written as a basis
for one-on-one or group tutorials and
exercises, and as a reference for
subsequent use.

Getting The Most


Recent Version Of This
Tutorial
You are reading Version 4.2, last
updated 2nd March 2021.
The most recent version of this
tutorial is always available at:
https://www.shellscript.sh. Always
check there for the latest copy. (If
you are reading this at some
different address, it is probably a
copy of the real site, and therefore
may be out of date).

A Brief History of sh
Steve Bourne wrote the Bourne shell
which appeared in the Seventh
Edition Bell Labs Research version of
Unix.
Many other shells have been written;
this particular tutorial concentrates
on the Bourne and the Bourne Again
shells.
Other shells include the Korn Shell
(ksh), the C Shell (csh), and
variations such as tcsh.
This tutorial does not cover those
shells.

Audience
This tutorial assumes some prior
experience; namely:

Use of an interactive Unix/Linux


shell
Minimal programming
knowledge - use of variables,
functions, is useful background
knowledge
Understanding of some
Unix/Linux commands, and
competence in using some of
the more common ones. (ls, cp,
echo, etc)
Programmers of rubyruby, perl
perl,
python
python, C , Pascal
Pascal, or any
programming language (even
BASIC) who can maybe read shell
scripts, but don't feel they
understand exactly how they
work.

You may want to review some of the


feedback that this tutorial has
received to see how useful you might
find it.

Typographical
Conventions Used in
This Tutorial
Significant words will be written in
italics when mentioned for the first
time.

Code segments and script output


will be displayed as monospaced
text.
Command-line entries will be
preceded by the Dollar sign ($). If
your prompt is different, enter the
command:

PS1="$ " ; export PS1

Then your interactions should match


the examples given (such as ./my-
script.sh below).
Script output (such as "Hello World"
below) is displayed at the start of the
line.

$ echo '#!/bin/sh' > my-scri


pt.sh
$ echo 'echo Hello World' >>
my-script.sh
$ chmod 755 my-script.sh
$ ./my-script.sh
Hello World
$
Entire scripts will be shown with a gray
background, and include a reference to
the plain text of the script, where
available:

my-script.sh
#!/bin/sh
# This is a comment!
echo Hello World # Th
is is a comment, too!

Note that to make a file executable,


you must set the eXecutable bit, and
for a shell script, the Readable bit must
also be set:
$ chmod a+rx my-script.sh
$ ./my-script.sh

Share

Next: Philosophy !

Download Free O'Reilly eBook


Learn how to build and manage an
experimentation platform. Get your
free eBook today!

Download Free O'Reilly eBook


Learn how to build and manage an
experimentation platform. Get your
free eBook today!

BOOKS AND EBOOKS

My Shell Scripting books,


available in Paperback and eBook
formats.

Buy this tutorial as a PDF for only

$5 $1!

Shell Scripting Shell Scripting: Expert


Tutorial is this Recipes for Linux,
tutorial, in 88- Bash and more is my
page Paperback 564-page book on
and eBook Shell Scripting. The
formats. first half explains the
Convenient to features of the shell;
read on the go, the second half has
and to keep by real-world shell
your desk as an scripts, organised by
ever-present topic, with detailed
companion. discussion of each
script.

CONTACT

You can mail me with this form. If


you expect a reply, please ensure
that the address you specify is valid.
Don't forget to include the simple
addition question at the end of the
form, to prove that you are a real
person!

Your Name...

Your Email...

Subject...

Leave your message...

Prove you're human: What is 2 + 7 - 1?

SEND MESSAGE

You can buy the


content of this
Shell Scripting
Tutorial as a PDF!

$5

Shell Scripting Tutorial


(PDF)
By steveparker

This tutorial is written to help people


understand some of the basics of
shell script scripting, and hopefully
to introduce some of the possibilities
of simple but powerful programming
available with the command line.

It benefits from having been read,


enjoyed and peer-reviewed by
hundreds of thousands of readers
over more than 10 years, to make it
one of the most popular shell
scripting tutorials available.

You can now buy this content


directly as a PDF to download to all
of your devices.

I want this!

25 ratings

This is a thorough yet practical


tutorial with examples throughout.
It has been written with extensive
feedback from hundreds of
thousands of readers. These
include new students as well as
academics and seasoned
professionals in the field. Some
have a long Unix and/or Linux
background, others have none.
This tutorial is currently cited by
at least seven different University
Degree courses around the world,
as a teaching resource for their
Undergraduates.

POWERED BY GUMROAD

Copyright © 2000 - 2018 Steve Parker

You might also like