Why is the $() needed in $(recast catalogue add <path to repo>) to set the catalogue path?

Part of the setup for running your RECAST workflow is to add the directory where you keep your recast.yml, specs/steps.yml and specs/workflow.yml files to the recast-atlas client’s catalogue using the command $(recast catalogue add <path to repo>) (see relevant section of recast docs).

Thanks to @jhaley for both posing the question of why the $() part is needed, and then sleuthing out the answer.

The command recast catalogue add <path to repo> doesn’t itself set the variable RECAST_ATLAS_CATALOGUE, it just returns the command needed to set this variable. Eg.

recast catalogue add $PWD


export RECAST_ATLAS_CATALOGUE=/var/lib/docker/monojet

Wrapping the expression in $() runs what is returned to set the RECAST_ATLAS_CATALOGUE env variable (see discussion on this in stackexchange forum).

Due to the docs migrating to https://recast.docs.cern.ch, the relevant links in the message above are: