Open postmodern opened 9 years ago
Do you have a suggestion?
Using #!/bin/bash
or #!/usr/bin/env bash
and targeting Bash >= 3 seems to be the safest. Most Linux distros have upgraded to Bash 4, while OSX still ships Bash 3.
@postmodern I'm interested in targeting bourne shell specifically.
I would then add checks for non-Bourne shells.
@postmodern Do you have pointers about how to do those checks? I'm not familiar.
Sorry it's taken me so long to circle back around to rust-installer. I've been on other things for a while, but starting a big upgrade now.
I normally explicitly check for $BASH_VERSION
or $ZSH_VERSION
. Not sure how you'd check whether a shell is bourne compatible.
It's not clear whether the rust-installer is targeting all POSIX shells or just Bourne shells.
/bin/sh
is not guaranteed to point to a Bourne-like shell. For example on Ubuntu,/bin/sh
is symlinked to/bin/dash
, or the Debian Almquist Shell.