Tech Blog: Shell Tips!

Shell Tips! is my personal Tech Blog about shell scripting, Bash, Linux, MacOS, Windows, and more. I have been writing on this blog since 2006, mostly for fun, to share acquired knowledge and consolidate various lessons learned. Check below for a sample of recent posts, and don't hesitate to reach out to me to share your thoughts or suggest improvements!

Performing Math Calculation In Bash

Find out how to do math with integer and floating-point arithmetic in Bash. We cover addition, subtraction, division, multiplication, and also floating-point precision.

How To Script Powerful Bash If Statement?

Learn how to script a Bash If statement with the then, else, and else if / elif clauses. This post covers the Bash conditional expressions, and how to avoid common pitfalls when using the Bash If statement.

How To Format Date And Time In Linux, MacOS, And Bash?

Find out how to manipulate date and time on linux and macOS systems as well as natively in the Bash shell. This post covers all you need to know to format a date from your shell.

Running Bash Script With Ubuntu On Windows 10 Using WSL

No-hassle! Learn how to run Bash on Windows by installing your favorite Linux distribution natively on Windows 10 using Windows Subsystem for Linux, aka WSL.

Iterate And Check If A Bash Array Contains A Value

Deep dive into the use of array variables (i.e. lists) and associative arrays (i.e. dictionaries or hash tables) in Bash. This post cover common usages to iterate efficiently over an array and access keys and values.

How To Parse A CSV File In Bash?

All you need to know to avoid the common pitfalls and safely parse a CSV file in Bash. This post cover examples using bash builtins to awk command line.

How to Solve Sudo and Tty issues?

Learn what is a tty and how to solve 'sudo: sorry, you must have a tty to run sudo' and 'sudo: no tty present and no askpass program specified' errors when using ssh to execute a sudo remote command.