Sample Header Ad - 728x90

Using `env` command with `eval`

0 votes
1 answer
1299 views
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?
Asked by sudoer (65 rep)
Sep 12, 2022, 01:32 PM
Last activity: Sep 12, 2022, 01:53 PM