Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
The Ultimate Linux Shell Scripting Guide

You're reading from   The Ultimate Linux Shell Scripting Guide Automate, Optimize, and Empower tasks with Linux Shell Scripting

Arrow left icon
Product type Paperback
Published in Oct 2024
Publisher Packt
ISBN-13 9781835463574
Length 696 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Donald A. Tevault Donald A. Tevault
Author Profile Icon Donald A. Tevault
Donald A. Tevault
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Preface 1. Getting Started with the Shell FREE CHAPTER 2. Interpreting Commands 3. Understanding Variables and Pipelines 4. Understanding Input/Output Redirection 5. Customizing the Environment 6. Text-Stream Filters – Part 1 7. Text Stream Filters – Part 2 8. Basic Shell Script Construction 9. Filtering Text with grep, sed, and Regular Expressions 10. Understanding Functions 11. Performing Mathematical Operations 12. Automating Scripts with here Documents and expect 13. Scripting with ImageMagick 14. Using awk – Part 1 15. Using awk – Part 2 16. Creating User Interfaces with yad, dialog, and xdialog 17. Using Shell Script Options with getops 18. Shell Scripting for Security Professionals 19. Shell Script Portability 20. Shell Script Security 21. Debugging Shell Scripts 22. Introduction to Z Shell Scripting 23. Using PowerShell on Linux 24. Other Books You May Enjoy
25. Index

Understanding Compiled versus Interpreted Programming

Compiled programming consists of writing program code in a text editor, and then using a compiler to convert the text file into an executable binary file. Once that’s done, users of the program won’t be able to easily view the source code of the program. With interpreted programming, the program runs directly from a text file, without having to compile it first.

Compiled programming languages, such as C, C++, or Fortran, are good for when you need maximum performance from your programs. However, they can be fairly hard to learn, especially when it comes to the lower-level functions such as working with files. Interpreted languages might not offer quite as high a level of performance, but they are generally quite flexible, and generally easier to learn. Interpreted languages in general also offer a higher degree of portability between different operating systems. Shell scripting falls into the category of interpreted languages.

Here are some reasons why you might consider using an interpreted language:

  • When you are looking for a simple solution.
  • When you need a solution that is portable. If you pay attention to portability concerns, you can write one script that will work on different Linux distros, as well as on Unix/Unix-like systems. That can come in handy if you’re working in a large corporation with a large network of mixed operating systems. (You might even find some larger corporations that are still running legacy Unix systems, such as AIX, HPUX, or SUNOS, alongside more modern implementations of Linux, BSD, or macOS.)

And, here are some reasons why you might consider using a compiled language:

  • When the tasks require intensive use of system resources. This is especially true when speed is extremely important.
  • When you are using math operations that require heavy number crunching.
  • When you need complex applications.
  • When your application has many sub-components with dependencies.
  • When you want to create proprietary applications, and prevent users from viewing the application source code.

When you think about it, pretty much every example of productivity, server, gaming, or scientific software falls into one or more of these categories, which means that they really should be built with compiled languages for best performance.

Okay, let’s now talk about sudo.

You have been reading a chapter from
The Ultimate Linux Shell Scripting Guide
Published in: Oct 2024
Publisher: Packt
ISBN-13: 9781835463574
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