Bash Scripting Basics: Commands, Conditionals and Loops
Bash scripting basics tested on Ubuntu and RHEL: variables, commands, arguments, exit codes, if and case, file tests, arithmetic, loops and a log checker.
Continue Reading →Every tutorial filed under Shell Scripting, newest first.
9 articles
Bash scripting basics tested on Ubuntu and RHEL: variables, commands, arguments, exit codes, if and case, file tests, arithmetic, loops and a log checker.
Continue Reading →Bash functions, arrays, getopts, trap, regex and parameter expansion explained with tested Ubuntu and RHEL examples, plus one small script that uses them all.
Continue Reading →Bash for, while and until loops tested on Ubuntu and RHEL: arguments, reading files line by line, safe filenames, polling timeouts and subshell bugs.
Continue Reading →Bash variables explained with real output: readonly, command substitution, integer math, ${var:-default}, string tricks, validation and quoting.
Continue Reading →Chain sort, uniq, cut, tr, tee and xargs into a real Bash report script, and see exactly why looping over ls output breaks on file names with spaces.
Continue Reading →See when .bash_logout really runs, use BASH_ENV to give cron jobs an environment, pick functions over aliases, master set vs shopt, and replay cron with env -i.
Continue Reading →Bash environment variables explained with real output: PATH, HOME, USER, SHELL, LANG, TERM, local vs exported variables, and which startup file Bash reads.
Continue Reading →Write and run your first Bash script, pick the right shebang (#!/bin/bash vs env), understand login and interactive shells, and know when to switch languages.
Continue Reading →What shell scripting is and how it runs on Linux, shell vs terminal, Bash vs sh vs zsh vs ksh vs fish, and why sysadmins and DevOps use it. Real output.
Continue Reading →