Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Linux Command Line and Shell Scripting Bible - Third Edition

You're reading from  Linux Command Line and Shell Scripting Bible - Third Edition

Product type Book
Published in Jan 2015
Publisher Wiley
ISBN-13 9781118983843
Pages 816 pages
Edition 3rd Edition
Languages
Authors (2):
Richard Blum Richard Blum
Profile icon Richard Blum
Christine Bresnahan Christine Bresnahan
Profile icon Christine Bresnahan
View More author details

Table of Contents (34) Chapters

1. Introduction 2. Part I: The Linux Command Line
3. Chapter 1: Starting with Linux Shells 4. Chapter 2: Getting to the Shell 5. Chapter 3: Basic bash Shell Commands 6. Chapter 4: More bash Shell Commands 7. Chapter 5: Understanding the Shell 8. Chapter 6: Using Linux Environment Variables 9. Chapter 7: Understanding Linux File Permissions 10. Chapter 8: Managing Filesystems 11. Chapter 9: Installing Software 12. Chapter 10: Working with Editors 13. Part II: Shell Scripting Basics
14. Chapter 11: Basic Script Building 15. Chapter 12: Using Structured Commands 16. Chapter 13: More Structured Commands 17. Chapter 14: Handling User Input 18. Chapter 15: Presenting Data 19. Chapter 16: Script Control 20. Part III: Advanced Shell Scripting
21. Chapter 17: Creating Functions 22. Chapter 18: Writing Scripts for Graphical Desktops 23. Chapter 19: Introducing sed and gawk 24. Chapter 20: Regular Expressions 25. Chapter 21: Advanced sed 26. Chapter 22: Advanced gawk 27. Chapter 23: Working with Alternative Shells 28. Part IV: Creating Practical Scripts
29. Chapter 24: Writing Simple Script Utilities 30. Chapter 25: Producing Scripts for Database, Web, and E-Mail 31. Chapter 26: Creating Fun Little Shell Scripts 32. End User License Agreement
Appendix A: Quick Guide to bash Commands 1. Appendix B: Quick Guide to sed and gawk

Scripting with zsh

The main purpose of the zsh shell was to provide an advanced programming environment for shell programmers. With that in mind, it's no surprise that the zsh shell offers many features that make shell scripting easier.

Mathematical operations

As you would expect, the zsh shell allows you to perform mathematical functions with ease. In the past, the Korn shell has led the way in supporting mathematical operations by providing support for floating-point numbers. The zsh shell has full support for floating-point numbers in all its mathematical operations!

Performing calculations

The zsh shell supports two methods for performing mathematical operations:

  • The let command
  • Double parentheses

When you use the let command, you should enclose the operation in double quotation marks to allow for spaces:

% let value1=" 4 * 5.1 / 3.2 "
% echo $value1
6.3750000000
%

Be careful, using floating point numbers may introduce a precision problem. To solve this, it&apos...

lock icon The rest of the chapter is locked
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 $15.99/month. Cancel anytime}