mirror of
https://github.com/dylanaraps/pure-bash-bible.git
synced 2025-08-19 05:51:20 +02:00
docs: update
This commit is contained in:
@@ -1562,12 +1562,15 @@ Use `#!/usr/bin/env bash` instead of `#!/bin/bash`.
|
|||||||
- The former searches the user's `PATH` to find the `bash` binary.
|
- The former searches the user's `PATH` to find the `bash` binary.
|
||||||
- The latter assumes it is always installed to `/bin/` which can cause issues.
|
- The latter assumes it is always installed to `/bin/` which can cause issues.
|
||||||
|
|
||||||
|
**NOTE**: There are times when one may have a good reason for using `#!/bin/bash` or another direct path to the binary.
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Right:
|
# Right:
|
||||||
|
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Wrong:
|
# Less right:
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
```
|
```
|
||||||
|
@@ -7,12 +7,15 @@ Use `#!/usr/bin/env bash` instead of `#!/bin/bash`.
|
|||||||
- The former searches the user's `PATH` to find the `bash` binary.
|
- The former searches the user's `PATH` to find the `bash` binary.
|
||||||
- The latter assumes it is always installed to `/bin/` which can cause issues.
|
- The latter assumes it is always installed to `/bin/` which can cause issues.
|
||||||
|
|
||||||
|
**NOTE**: There are times when one may have a good reason for using `#!/bin/bash` or another direct path to the binary.
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Right:
|
# Right:
|
||||||
|
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Wrong:
|
# Less right:
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user