[PATCH] Use "#!/usr/bin/env bash" to run a bash script

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Dec 30 08:30:39 CST 2006


On 2006-12-30 16:17, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> # HG changeset patch
> # User Giorgos Keramidas <keramida at ceid.upatras.gr>
> # Date 1167487843 -7200
> # Node ID 641c3bb47e839842f05e28a86473efc6555a49ac
> # Parent  050d88306939bd477fc0fda6333db9ab8b8ff2a0
> Use "#!/usr/bin/env bash" to run a bash script
>
> On FreeBSD, there is no /bin/bash executable, but if one the
> shells/bash* ports is installed we have an installed executable
> of bash in /usr/local/bin/bash.  Let env(1) locate it for us.
>
> diff -r 050d88306939 -r 641c3bb47e83 tests/test-issue352
> --- a/tests/test-issue352	Wed Dec 27 17:44:22 2006 +0200
> +++ b/tests/test-issue352	Sat Dec 30 16:10:43 2006 +0200
> @@ -1,4 +1,4 @@
> -#!/bin/bash
> +#!/usr/bin/env bash
>  # http://www.selenic.com/mercurial/bts/issue352
>
>  hg init foo

This fixes the only failing test of a recent crew snapshot on an
also fairly recent FreeBSD 7.0-CURRENT build.  The last crew
changeset I have here is:

    changeset:   3993:04d919cdf263
    tag:         tip
    user:        Thomas Arendsen Hein <thomas at intevation.de>
    date:        Tue Dec 26 20:08:09 2006 +0100
    summary:     expanded bash_completion for transplant extension

and the only test that failed was:

    $ python run-tests.py
    ...................................................................
    ERROR: test-issue352 output changed
    --- Expected output
    +++ Test output
    @@ -1,7 +1,1 @@
    lloding he
    -abort: '\n' and '\r' disallowed in filenames
    lloding he
    -abort: '\n' and '\r' disallowed in filenames
    -hell
    -o
    -nothing changed
    +/home/keramida/hg/mercurial/gker/tests/test-issue352: not found

    ERROR: test-issue352 failed with error code 32512
    .........................................................................
    # Ran 140 tests, 0 skipped, 1 failed.
    $



More information about the Mercurial-devel mailing list