Eric Blake
2018-Aug-13 21:14 UTC
Re: [Libguestfs] [PATCH nbdkit 08/10] freebsd: In scripts use 'env bash' instead of '/bin/bash'.
On 08/12/2018 03:51 AM, Richard W.M. Jones wrote:> The path to bash on FreeBSD is /usr/local/bin/bash. > ---> +++ b/docs/make-links.sh > @@ -1,4 +1,4 @@ > -#!/bin/bash - > +#!/usr/bin/env bashThis loses the '-' argument that used to be passed by the kernel (but you can't add it back to the #! linew without using BSD's or GNU coreutils' recent addition of 'env -S'). Is it worth adding a 'set -' line later in the script to compensate, if you were previously passing the '-' as a way to reset the shell from inheriting environmental differences? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Richard W.M. Jones
2018-Aug-13 21:23 UTC
Re: [Libguestfs] [PATCH nbdkit 08/10] freebsd: In scripts use 'env bash' instead of '/bin/bash'.
On Mon, Aug 13, 2018 at 04:14:13PM -0500, Eric Blake wrote:> On 08/12/2018 03:51 AM, Richard W.M. Jones wrote: > >The path to bash on FreeBSD is /usr/local/bin/bash. > >--- > > >+++ b/docs/make-links.sh > >@@ -1,4 +1,4 @@ > >-#!/bin/bash - > >+#!/usr/bin/env bash > > This loses the '-' argument that used to be passed by the kernel > (but you can't add it back to the #! linew without using BSD's or > GNU coreutils' recent addition of 'env -S'). Is it worth adding a > 'set -' line later in the script to compensate, if you were > previously passing the '-' as a way to reset the shell from > inheriting environmental differences?I actually had no idea what the '-' did until now :-) I guess we need it. I can add set - to these scripts as required. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Eric Blake
2018-Aug-13 22:10 UTC
Re: [Libguestfs] [PATCH nbdkit 08/10] freebsd: In scripts use 'env bash' instead of '/bin/bash'.
On 08/13/2018 04:23 PM, Richard W.M. Jones wrote:> On Mon, Aug 13, 2018 at 04:14:13PM -0500, Eric Blake wrote: >> On 08/12/2018 03:51 AM, Richard W.M. Jones wrote: >>> The path to bash on FreeBSD is /usr/local/bin/bash. >>> --- >> >>> +++ b/docs/make-links.sh >>> @@ -1,4 +1,4 @@ >>> -#!/bin/bash - >>> +#!/usr/bin/env bash >> >> This loses the '-' argument that used to be passed by the kernel >> (but you can't add it back to the #! linew without using BSD's or >> GNU coreutils' recent addition of 'env -S'). Is it worth adding a >> 'set -' line later in the script to compensate, if you were >> previously passing the '-' as a way to reset the shell from >> inheriting environmental differences? > > I actually had no idea what the '-' did until now :-)Actually, I'm not sure if it does anything. 'set -u' isn't inherited across a #! setup, and I doubt anything else that 'set' controls would have an effect either (or people would have complained long before now on scripts that just do '#!/bin/bash' instead of '#!/bin/bash -').> > I guess we need it. I can add > > set - > > to these scripts as required.Only if it makes a difference that you can actually observe in testing - don't bother to do it otherwise. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Possibly Parallel Threads
- Re: [PATCH nbdkit 08/10] freebsd: In scripts use 'env bash' instead of '/bin/bash'.
- [PATCH nbdkit 08/10] freebsd: In scripts use 'env bash' instead of '/bin/bash'.
- [PATCH nbdkit 00/10] FreeBSD support.
- Re: Further nbdkit patches for Haiku
- [PATCH nbdkit 2/4] common/protocol: Remove protostrings.sed, use bash+sed instead.