I have a tox environment in which I want to run a bash command (basename) on {posargs} and use the result in a subsequent command. I've tried the various ways it is possible to do this in bash, but they haven't been working. This snippet captures the spirit of what I'm trying to accomplish.
[testenv:docs]
commands =
export PACKAGE=$(basename {posargs})
ls $PACKAGE
toxruns every command in a new shell so when the first command finishes the env var disappears. You have to save it somewhere in a permanent storage like a file. Or change approach completely like passing preprocessed{posargs}and use them in all commands down the pipeline.