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

Hello,

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 coreutils/NEWS at master · coreutils/coreutils · GitHub , env -S is new in Coreutils 8.30.

Update: it’s available in Focal: Ubuntu – Details of package coreutils in focal.


Ubuntu – Error 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.

1 Like