Portability of shell scripts from other *nixes

Da Rock freebsd-questions at herveybayaustralia.com.au
Thu Jan 26 00:03:23 UTC 2012

On 01/26/12 08:08, Doug Poland wrote:
> Hello,
> 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.
Cant you simply change the shebang to !#/usr/local/bin/bash?

More information about the freebsd-questions mailing list