What we do
- We currently do not use any cookies of our own.
- We do use Google Analytics.
- We do use Google Captcha.
- We do use Amazon affiliate to show purchaseable items like books that are related to the website content.
What we don't
- Sell or handover any information we may have on you, or information that is created when you visit or interact with our website.
Tell Me in English
We don't currently use any cookies of our own. We use Google Analytics, Google Captcha and Amazon Affiliate program.
This site is a reference for the scripting language Bash
Bash (Bourne Again Shell) is a shell language build on-top of the orignal Bourne Shell which was distributed with V7 Unix in 1979 and became the standard for writing shell scripts. Today it is primary to most Linux distributions, MacOS and it has even recently been enabled to run on Windows through something called WSL (Windows Subsystem for Linux).
File Test Operators
Used for testing of files files in shellscripts
Testing files in scripts is easy and straight forward. This is where shell scripting starts to show its glory! In Bash you can do file testing for permissions, size, date, filetype or existence.
Used for string comparison in Bash
This section describes how to compare strings in Bash.
Used for comparing numbers
How to compare integers or arithmetic expressions in shell scripts.
Job control allows you to selectively stop (suspend) the execution of processes and continue their execution at a later point in time.
System V Signals
UNIX System V Signals.
Reserved Exit Codes
Useful for debugging a script. Exit takes integer args in the range 0-255.
|Exit Code No.||Description|
Catchall for general errors
Misuse of shell builtins
Command invoked cannot execute
Command not found
Invalid argument to exit
Fatal error signal "n"
Script terminated by Control-C
Sending Control Signals
You can use these key-combinations to send signals or control the output. Check your stty settings. Suspend and resume of output is usually disabled if you are using "modern" terminal emulations. The standard xterm supports Ctrl+S and Ctrl+Q by default.
Shortcuts to use in the CLI for swiftly editing a command. These shortcuts are provided by the GNU Readline library.
Now you may know what that arcane looking string rwxrwxrwx is when you invoke ls -l
Bash supports a surprisingly big number of string operations! Unfortunately, these tools lack a unified focus. Some are a subset of parameter substitution, and others fall under the functionality of the UNIX expr command. This results in inconsistent command syntax and overlap of functionality.
The following text shows characters that need to be quoted if you want to use their literal symbols and not their special meaning.
Command parameters, also known as arguments, are used when invoking a Bash script.
Enables use and manipulation of previous commands.
Bash cannot recognize RegEx but understand globbing. Globbing is done to filenames by the shell while RegEx is used for searching text.
Matches zero or more occurences of a given pattern
Matches zero or one occurences of a given pattern
Matches one or more occurences of a given pattern
Negates any pattern matches — reverses the pattern so to speak
Character Classes in BRE
A character class is a pattern you can use instead of a regular expression. They are easier to remember and work with.
Flow control structures in Bash are straight forward, albeit Bash is unforgiving if you get the syntax wrong.
Overview of Bash Symbols
Here we have gathered a collection of all arcane syntax along with a brief description. A bunch of these symbols are repeated from earlier but many are new - this is a good starting point if you are new to the language.
Shell builins are built into Bash are often very (if not extremely) fast compared to external programs. Some of the builtins are inherited from the Bourne Shell (sh) — these inherited commands will also work in the original Bourne Shell.
Online Resources & Books
A group of severe privilege escalation vulnerabilities existing in the wild for about 25 years
Greg's Wiki 🧠
A lot of great articles teaching good practices and how to avoid pitfalls
A linter to check your shellscripts. Extremely useful
Explain Shell 🐚
If you have wondered how a fork-bomb or any similar obscure command is parsed and executed
GNU Bash Manual
Perhaps the most comphehensive manual out there
Everything you need really.
Shell Style Guide
Google's style guide for shellscripts