Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Bash Quick Start Guide

You're reading from   Bash Quick Start Guide Get up and running with shell scripting with Bash

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781789538830
Length 186 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Tom Ryder Tom Ryder
Author Profile Icon Tom Ryder
Tom Ryder
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. What is Bash? FREE CHAPTER 2. Bash Command Structure 3. Essential Commands 4. Input, Output, and Redirection 5. Variables and Patterns 6. Loops and Conditionals 7. Scripts, Functions, and Aliases 8. Best Practices 9. Other Books You May Enjoy

Identifying the Bash version number

Before we start writing commands and programming with Bash, it's a good idea to find out what version of Bash you have installed. This is because newer versions of Bash have useful new features that might be discussed in this book, but that might not be available in your version of Bash.

You can check the version of your current running shell by printing the value of the BASH_VERSION variable:

bash$ declare -p BASH_VERSION
declare -- BASH_VERSION="4.4.12(1)-release"

You can get the same information by invoking the bash program with its --version option, which provides some extra information about the program's version number and software license:

$ bash --version
GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

The most recent stable minor version of GNU Bash at the time of writing is version 4.4, with version 4.4.0 released in September 2016.

In this book, we will focus on the features of Bash that were available in GNU Bash version 4.0, which was released in 2011, and is very widely available as a minimum version.

If the version of Bash installed on your computer is older than 4.0, some of the scripts and features discussed in this book may not work correctly. You or your system administrator should use your operating system to upgrade your Bash shell to a newer version.

You have been reading a chapter from
Bash Quick Start Guide
Published in: Sep 2018
Publisher: Packt
ISBN-13: 9781789538830
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime