Hey Jacob,
On Tue, Nov 09 2021, Jacob Hrbek wrote:
For now I use “#!/usr/bin/env -S guix shell --”, which works
well enough for me. How does that sound? -- l...@gnu.org
Not a solution as (AFIAK) POSIX only accepts one argument.
That's the point of the -S. It passes the entire rest of the line
as a single argument to /usr/bin/env, which reads it as a single
-S argument which /usr/bin/env then interprets as a command with
arguments.
Something like how this doesn't work:
$ /usr/bin/env 'echo hello'
/usr/bin/env: ‘echo hello’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
But this does:
$ /usr/bin/env '-S echo hello'
hello
It looks like this was added to coreutils in 2018 in version 8.30.
I wasn't aware of this feature until seeing Ludo's email, but it
seems like a neat solution to the problem.
Carlo