Book Image

Linux Mint Essentials

By : Jay LaCroix
Book Image

Linux Mint Essentials

By: Jay LaCroix

Overview of this book

A task-oriented look at Linux Mint, using actual real-world examples to stimulate learning. Each topic is presented in an easy-to-follow order, with hands-on activities to reinforce the content. If you are starting out with Linux from a different platform or are well versed with Linux Mint and want a guide that shows you how to exploit certain functionality, this book is for you. No previous Linux experience is assumed.
Table of Contents (17 chapters)
16
Index

Using variables and conditional statements in Bash

We covered a brief introduction to Bash scripting at the end of Chapter 4, An Introduction to the Terminal. In the previous section, we created a simple script that monitors the temperature of your computer's CPU in almost real time. While useful, this script, in particular, won't save you a lot of time, since you can use the sensors command to do the same thing with almost the same amount of time. Bash really shines because of the fact that it has all the features you'd expect from an actual programming language, including if statements and variables. Bash scripting is used by many administrators to simplify and automate tasks. Paired with cron, you can easily create scripts to automatically run, and with enough skill, completely set up a Linux computer from a bare installation of a distribution to a fully functioning system for a specific purpose.

Before we continue, recall two very important requirements for scripting....