How To Write Bash Scripts In Linux - Complete Guide (Part 4 - Basic Math)
Learn Linux TV
@learnlinuxtvAbout
Learn Linux TV is your ultimate resource for mastering Linux and open-source technology. From step-by-step Linux tutorials and distro reviews to server automation, cloud deployments, security, and DevOps workflows, this channel gives you the skills to thrive in today’s Linux Community. With over 20 years of Linux and System Administration experience, Jay (your host) shares practical insights to help you succeed with Linux — whether at home, in the data center, or in the cloud. Whether it’s Debian, Ubuntu, Fedora, Arch, or Proxmox, you’ll learn how to build, secure, and manage systems with confidence! • Linux made simple: tutorials, reviews, and sysadmin tips you can actually use. • Your go-to channel for Linux tutorials, distro reviews, and real-world sysadmin skills. • Where beginners become power users, and pros sharpen their Linux skills. Subscribe and join a community of hundreds of thousands of Linux enthusiasts who are learning, building, and growing with open source.
Latest Posts
Video Description
Master basic math operations in Bash with this quick and easy tutorial! In this episode of LearnLinuxTV’s complete Bash Scripting course, you’ll learn how to perform arithmetic in Bash, including addition, subtraction, multiplication, and more. Bash handles math differently than other scripting languages, so understanding these concepts early on will help you avoid confusion down the road. This short tutorial is just six minutes long, and it’s packed with practical examples to boost your scripting skills. *Brand New Ansible Course Available* Check out the new course on Udemy! It covers everything you need to get started with Automation. ➜ https://learnlinux.link/ansible *Individual Sections* 00:00 - Intro 01:00 - Math is handled differently in Bash 01:28 - The "evaluate expression" command (expr) in Bash 02:37 - Multiplication in Bash (and how to use an escape symbol) 03:48 - Using variables with math expressions *OTHER BASH SCRIPTING SERIES EPISODES* - Class 01 ➜ Introduction: https://linux.video/bash1 - Class 02 ➜ Hello World: https://linux.video/bash2 - Class 03 ➜ Variables: https://linux.video/bash3 - Class 04 ➜ Math Functions: https://linux.video/bash4 - Class 05 ➜ If Statements: https://linux.video/bash5 - Class 06 ➜ Exit Codes: https://linux.video/bash6 - Class 07 ➜ While Loops: https://linux.video/bash7 - Class 08 ➜ Universal Update Script: https://linux.video/bash8 - Class 09 ➜ For Loops: https://linux.video/bash9 - Class 10 ➜ Where To Store Your Scripts: https://linux.video/bash10 - Class 11 ➜ Data Streams: https://linux.video/bash11 - Class 12 ➜ Functions: https://linux.video/bash12 - Class 13 ➜ Case Statements: https://linux.video/bash13 - Class 14 ➜ Scheduling Jobs (Part 1): https://linux.video/bash14 - Class 15 ➜ Scheduling Jobs (Part 2): https://linux.video/bash15 - Class 16 ➜ Arguments: https://linux.video/bash16 - Class 17 ➜ Building a Backup Script: https://linux.video/bash17 - Class 18 ➜ Closing: https://linux.video/bash18*🎓 Full Linux Courses* • Linux Crash Course ➜ https://linux.video/cc • Netdata ➜ https://linux.video/netdata • tmux ➜ https://linux.video/tmux • vim ➜ https://linux.video/vim • Bash Scripting ➜ https://linux.video/bash • Proxmox VE ➜ https://linux.video/pve • Ansible (Paid) ➜ https://learnlinux.link/ansible • LPI Linux Essentials (Paid) ➜ https://learnlinux.link/linux-essentials *🎓 More About Learn Linux TV* • Main site ➜ https://www.learnlinux.tv • Community Forums ➜ https://community.learnlinux.tv • Github Account ➜ https://github.com/LearnLinuxTV • Content Ethics ➜ https://www.learnlinux.tv/content-ethics • Request Paid Assistance ➜ https://www.learnlinux.tv/request-assistance ⚠️ Use Content Responsibly Learn Linux TV shares technical content intended to teach and help you, but it comes with no warranty. The channel is not liable for any damages from its use. Always ensure you have proper permissions, follow company policies, and comply with all applicable laws while working with infrastructure. #linux #baschscripting #linuxforbeginners
Upgrade Your Everyday
AI-recommended products based on this video

Amazon Echo Show 8 (newest model), With Spatial Audio, Smart Home Hub, and Alexa, Charcoal

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, with Active Noise Cancellation, Adaptive Audio, Transparency Mode, Personalized Spatial Audio, USB-C Charging Case, Wireless Charging, H2 Chip

Wireless Earbuds, Bluetooth 5.4 Headphones, True Wireless Stereo Earphones with IPX7 Waterproof, Noise Cancelling Mic, Fast Charging and Comfort Fit Ear Buds for Sports/Workouts - Black

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, Personalized Spatial Audio, Sweat and Water Resistant, USB-C Charging Case, H2 Chip, Up to 30 Hours of Battery Life, Effortless Setup for iPhone

Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Smart Watch for Men/Women, 1.95" AMOLED Fitness Tracker Watches with Bluetooth Calls/Flashlight/100+ Sport Modes Heart Rate/Sleep Monitor Ultra Lightweight Ultrathin Design

Smart Watch for Men Women (Answer/Make Call), 1.96" HD Smartwatch Fitness Activity Tracker, 110+ Sports IP68 Waterproof, Heart Rate/Sleep Monitor/Pedometer/Calories, Fitness Watch for Android iOS
![Apple Watch Series 10 [GPS 46mm case] Smartwatch with Rose Gold Aluminium Case with Light Blush Sport Band - M/L. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant](https://m.media-amazon.com/images/I/61nNNMI1cFL._AC_UL960_FMwebp_QL65_.jpg)
Apple Watch Series 10 [GPS 46mm case] Smartwatch with Rose Gold Aluminium Case with Light Blush Sport Band - M/L. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant
![Apple Watch Series 10 [GPS 42mm case] Smartwatch with Jet Black Aluminium Case with Black Sport Band - S/M. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant](https://m.media-amazon.com/images/I/6105jZyXyPL._AC_UL960_FMwebp_QL65_.jpg)
Apple Watch Series 10 [GPS 42mm case] Smartwatch with Jet Black Aluminium Case with Black Sport Band - S/M. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant

NOCO Boost GB40: 1000A UltraSafe Jump Starter – 12V Lithium Battery Booster Pack, Portable Jump Box, Power Bank & Jumper Cables - for 6.0L Gas and 3.0L Diesel Engines

UGREEN Nexode Power Bank 20000mAh 130W Portable Charger 72Wh PD Fast Charging 3-Port USB C Battery Pack with TFT Smart Display for MacBook/iPad/iPhone 16/Samsung S24 and More

ANKER 737 Power Bank, 24,000mAh 3-Port Laptop Portable Charger with 140W Fast Charging, Smart Display, for Outdoor Work, Compatible with iPhone 16/15/14 Series, Vision Pro, Samsung, MacBook, and More

VOLTME Portable Charger, Slim 10000mAh 5V/3A Power Bank, USB C in&Out High-Speed Charging Battery Pack, Travel Essentials Dual Output Compatible with iPhone 16 15 14 13 12 Samsung Google iPad etc

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, with Active Noise Cancellation, Adaptive Audio, Transparency Mode, Personalized Spatial Audio, USB-C Charging Case, Wireless Charging, H2 Chip

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, Personalized Spatial Audio, Sweat and Water Resistant, USB-C Charging Case, H2 Chip, Up to 30 Hours of Battery Life, Effortless Setup for iPhone

Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Bose QuietComfort Bluetooth Headphones, Wireless Headphones with Active Over Ear Noise Cancelling and Mic, Deep Bass, Up to 24 Hours of Playtime, White Smoke

Barnyard Designs Indoor Herb Garden Planter Set with Tray, Metal Windowsill Plant Pots with Drainage for Outdoor or Indoor Plants, Set/3 (Black)

Eye Contact Web Camera for Desktop Computer – 1080P USB Camera with Microphone & Stand, Center Cam for Laptop or Desktop, Manual Focus, Plug & Play for macOS & Windows(Black)
![PEHAEL 3+3Pack for iPhone 17 Pro Max Privacy Screen Protector with Camera Lens Protector Full Coverage Anti-Spy Tempered Glass Film 9H Hardness Easy Installation Bubble Free [6.9 inch]](https://m.media-amazon.com/images/I/61PnVkv6KKL._AC_UL960_FMwebp_QL65_.jpg)
PEHAEL 3+3Pack for iPhone 17 Pro Max Privacy Screen Protector with Camera Lens Protector Full Coverage Anti-Spy Tempered Glass Film 9H Hardness Easy Installation Bubble Free [6.9 inch]
![Ailun 3 Pack Screen Protector for iPhone 16 Pro Max [6.9 inch] + 3 Pack Camera Lens Protector with Installation Frame,Sensor Protection,Dynamic Island Compatible,Case Friendly Tempered Glass Film](https://m.media-amazon.com/images/I/815keamN-BL._AC_UL960_FMwebp_QL65_.jpg)
Ailun 3 Pack Screen Protector for iPhone 16 Pro Max [6.9 inch] + 3 Pack Camera Lens Protector with Installation Frame,Sensor Protection,Dynamic Island Compatible,Case Friendly Tempered Glass Film







































