Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15432 > unrolled thread
| Started by | Stephane Chazelas <stephane.chazelas@gmail.com> |
|---|---|
| First post | 2019-09-25 22:36 +0100 |
| Last post | 2019-09-25 22:36 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] docs: More hints on #! parsing Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-09-25 22:36 +0100
| From | Stephane Chazelas <stephane.chazelas@gmail.com> |
|---|---|
| Date | 2019-09-25 22:36 +0100 |
| Subject | Re: [PATCH] docs: More hints on #! parsing |
| Message-ID | <mailman.1109.1569447471.2190.bug-bash@gnu.org> |
2019-09-25 15:33:24 -0500, Eric Blake:
[...]
> Bash scripts often begin with @code{#! /bin/bash} (assuming that
> Bash has been installed in @file{/bin}), since this ensures that
> Bash will be used to interpret the script, even if it is executed
> -under another shell.
> +under another shell. Another common practice is the use of
> +@code{#!/bin/env bash} to find the first instance of bash on @env{PATH}.
[...]
env is more commonly found in /usr/bin. There's no env in /bin
on Ubuntu or FreeBSD for instance.
Using "#! /bin/bash -" is also good practice (so your script
still works when its path starts with - or +, see also
https://unix.stackexchange.com/questions/351729/why-the-in-the-bin-sh-shebang
for more historical context).
--
Stephane
Back to top | Article view | gnu.bash.bug
csiph-web