

It’s a popular free Unix shell preinstalled on most Linux distros and on macOS. Some classic Unix shells you may have heard of include the Bash shell (short for “ Bourne Again Shell”), the C shell, or the Korn shell. However, people generally use the term to refer specifically to a command line interface (CLI) - an interface consisting of lines of text that you interact with using only the keyboard. A shell can be a graphical user interface (GUI), like the Windows shell. In the computing world, a shell is a program that serves as an interface for the underlying OS. If a command requires one of these versions of Bash, it will be mentioned below. While even older Bash versions give you a lot of power, Bash 3 and 4 both introduce nice shorthand notations for certain basic commands. To find your Bash version, run the bash –version command. You’ll need to install a Linux distribution under the Windows Subsystem for Linux (WSL) to run Bash. PowerShell is the default command-line shell in Windows. Windows does not come bundled with Bash.There are steps to get Bash onto Android, which this article won’t go into. (You can check by looking if your system includes the /bin/bash file.) Android is a special case that doesn’t ship with Bash. Linux distributions generally have Bash installed.As long as Bash is installed, you can run Bash scripts from zsh too. On more recent versions, the Z shell (zsh) is the default shell, and that’s ok. As for Bash, whether you have it pre-installed will depend on your platform: The terminal emulator is where you’ll type commands and run them by hitting Enter or Return. A terminal emulator, an application that comes preinstalled with most operating systems and is often called Terminal, Console, or Command Prompt.Any plain text editor, such as Notepad, Text Editor, TextEdit, vi, emacs, or Visual Studio Code.To write and run a Bash script, you only need three things: What you need to learn Bash shell scripting Passing data to a function using variables.Setting and returning exit codes in a shell script.Printing special characters in a string.How to get user input in a shell script.Iterating through files using a for loop.Using globbing to get files matching a pattern.Repeating a series of commands using a for loop.Using the if statement to run code conditionally.Setting permissions to run a shell script using chmod.What you need to learn Bash shell scripting.
