From a6c9147eb61bdd0b8e349114c152d08528746c39 Mon Sep 17 00:00:00 2001 From: Elbakyan Shirak Date: Sun, 28 Jul 2024 12:15:57 +0400 Subject: [PATCH] Add shebang information --- ebook/en/content/002-bash-structure.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ebook/en/content/002-bash-structure.md b/ebook/en/content/002-bash-structure.md index f02f3a4..9cc7d59 100644 --- a/ebook/en/content/002-bash-structure.md +++ b/ebook/en/content/002-bash-structure.md @@ -22,4 +22,11 @@ In order to execute/run a bash script file with the bash shell interpreter, the This is also called a [Shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)). -All that the shebang does is to instruct the operating system to run the script with the `/bin/bash` executable. +All that the shebang does is to instruct the operating system to run the script with the `/bin/bash` executable. + +However, bash is not always in `/bin/bash` directory, particularly on non-Linux systems or due to installation as an optional package. Thus, you may want to use: + +```bash +#!/usr/bin/env bash +``` +It searches for bash executable in directories, listed in PATH environmental variable.