/usr/bin/env: invalid option -- 'S'


I’m getting the following error on default linux VMs: /usr/bin/env: invalid option -- 'S'. The error comes from a script with header

#!/usr/bin/env -S bash -f

Here’s a link to the error: https://travis-ci.org/ralna/SIFDecode/jobs/646673572#L419

I gather from Google that only “recent” versions of /usr/bin/env support the -S option. What options should I set in .travis.yml to select an image with such a recent version?

Thanks in advance!

As per https://github.com/coreutils/coreutils/blob/master/NEWS , env -S is new in Coreutils 8.30.

https://packages.ubuntu.com/disco/coreutils shows that it’s only available since Disco.

So if you require it, you’ll need to either install it from source or a 3rd-party package if one exists, or run your build in a Docker container representing a newer Ubuntu.