Skip to content

Commit f33bada

Browse files
author
Elbakyan Shirak
authored
Add shebang information (#155)
1 parent 946925c commit f33bada

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ebook/en/content/002-bash-structure.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@ In order to execute/run a bash script file with the bash shell interpreter, the
2222

2323
This is also called a [Shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)).
2424

25-
All that the shebang does is to instruct the operating system to run the script with the `/bin/bash` executable.
25+
All that the shebang does is to instruct the operating system to run the script with the `/bin/bash` executable.
26+
27+
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:
28+
29+
```bash
30+
#!/usr/bin/env bash
31+
```
32+
It searches for bash executable in directories, listed in PATH environmental variable.

0 commit comments

Comments
 (0)