Skip to content

Add shebang information #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ebook/en/content/002-bash-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.