It worked.
#!/usr/bin/env bash
set -x
docker exec -it pure-ftpd ftp localhost
printenv
It failed, because of "the input device is not a TTY".
#!/usr/bin/env bash
set -x
{
echo "docker exec -it pure-ftpd ftp localhost"
} | {
bash
printenv
}
And environment variables of two scripts are same. Can someone tell me what is the difference? And SDKMAN use pipelines(2nd way) to run the script, when should not use pipelines?
bash -c
orxargs
?