Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2012 17:13:36 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Doug Poland <doug@polands.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Portability of shell scripts from other *nixes
Message-ID:  <alpine.BSF.2.00.1201251710580.12901@wonkity.com>
In-Reply-To: <ac1be76b3dd10516e61861ae253b793f.squirrel@email.polands.org>
References:  <ac1be76b3dd10516e61861ae253b793f.squirrel@email.polands.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 25 Jan 2012, Doug Poland wrote:

> I'm trying port some shell scripts to FreeBSD that were originally
> written on Darwin (OS X).
>
> The issue I'm having is the shebang line of the scripts in OS X is
> #!/bin/sh, and it turns out that is really an instance of bash, and
> the code contains some bashisms.  On FreeBSD I have bash in
> /usr/local/bin/bash.
>
> Is there an "easy/best" way to have a single shebang that works on
> both OS's?  I'd rather not change FreeBSD's bourne shell to bash with
> any symlinking of /usr/local/bin/bash to /bin/sh.

Turns out that causes mysterious problems:
http://forums.freebsd.org/showthread.php?t=29088



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1201251710580.12901>