Suppose I have this in script.sh
:
env -i SOMEVAR=SOMEVALUE eval -- "$@"
I run it with:
./script.sh echo "\$SOMEVAR"
Now it shows:
env: ‘eval’: No such file or directory
I suppose it doesn't work because eval
is a Bash builtin.
Any way to make env
work with eval
?
env
expect a command (so on PATH), but you provide with a keyword. Just replace it withsh eval
.sh
, why bother witheval
at all?