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

Preface

The GNU Bourne-Again Shell, or Bash, is the best-known Bourne-style shell in the world, and is installed or available for installation on a huge variety of Unix-like systems. Even professionals who don't do a lot of work with Unix or Linux will need to use the Bash shell occasionally.

Bash is a language of contradictions; while it's the best-known and most widely-deployed shell of its kind, it's perhaps also one of the least-understood tools, with a terse syntax that's relatively unique among modern programming languages and can seem bizarre even to experienced users. Bash is powerful in some ways, and very limited in others. It's clear, elegant, and expressive in some ways, and terse, clumsy, and bewildering in others.

Because it's so powerful and yet so complex, and because so many computer professionals can't avoid using it at least occasionally, Bash is often learned by way of a kind of "tradition;" demonstrations by experienced administrators, reading others' scripts, copying and pasting, and asking questions and reading answers on the internet. This leads to a lot of "cargo-cult programming," and a lot of bad practices that make things unnecessarily confusing at best, and downright dangerous at worst. The available documentation for Bash is often unhelpful in addressing this problem—it often teaches the same bad practices, and even when it's correct, as the official Bash manual page is, it's often too complicated and assumes too much knowledge for new users to understand it.

To avoid all that, we'll start learning good Bash from first principles, and focus almost exclusively on writing the language well, in both interactive and batch mode. By the end of this book, you'll have a firm grasp on how to write Bash shell script in a robust and understandable way, and be in a position to notice bad habits and dangerous "hot spots" in others' code. You'll have a great grasp on the problems for which shell script is a perfect solution, and writing it will be a lot more efficient, and maybe even fun.

lock icon The rest of the chapter is locked
Next Section arrow right
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