Add support for passing multiple arguments to env utility via `-S` agument
Most of Linux distributions have support for -S
argument in env
utility, but alpine
misses it, even latest release.
This key is very useful to allow launching scripts with several arguments. Here are some examples and provided workarounds for this feature:
- https://stackoverflow.com/questions/4303128/how-to-use-multiple-arguments-for-awk-with-a-shebang-i-e
- https://unix.stackexchange.com/questions/63979/shebang-line-with-usr-bin-env-command-argument-fails-on-linux
But the best way is to just have native support for -S
. Is it hard to add it to alpine
?
So many command line scripts are using shebang commands to work with multiple arguments like this:
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings
And they works well on debian/centos/other linux images, but stops working on any alpine image.
Here is current env
arguments, available in alpine:
$ docker run -it alpine:latest env --help
BusyBox v1.34.1 (2021-11-23 00:57:35 UTC) multi-call binary.
Usage: env [-i0] [-u NAME]... [-] [NAME=VALUE]... [PROG ARGS]
Print current environment or run PROG after setting up environment
-, -i Start with empty environment
-0 NUL terminated output
-u NAME Remove variable from environment
And here is the same command from old debian:
$ docker run -it debian:oldstable env --help
Usage: env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
Set each NAME to VALUE in the environment and run COMMAND.
Mandatory arguments to long options are mandatory for short options too.
-i, --ignore-environment start with an empty environment
-0, --null end each output line with NUL, not newline
-u, --unset=NAME remove variable from the environment
-C, --chdir=DIR change working directory to DIR
-S, --split-string=S process and split S into separate arguments;
used to pass multiple arguments on shebang lines
-v, --debug print verbose information for each processing step
--help display this help and exit
--version output version information and exit
Maybe simple updating of busybox
package to latest version can help with resolving this issue?