Sample Header Ad - 728x90

how to pass environment variables to singularity exec

3 votes
1 answer
702 views
I have a BASH pipeline which at a point runs a Singularity container with *singularity exec* as follows:
singularity exec --bind pwd:/folder --bind $d:/results .sif  -i /folder/.fastq -v /results//.vcf -r /folder/.fna -s  -j 24 -t 24 -o /results/
Since I'm running multiple experiments at once with an array, I'm redefining the experiments with an environment variable that I wish to add to the `; it works for all the steps of the pipeline but Singularity` seems it's unable to *see* the variable(s) I'm defining in my script... Does anyone have any advice on how to do so? I looked up a bit but the --env does not seem to be working. Thanks in advance!
Asked by Matteo (209 rep)
Apr 13, 2025, 12:51 PM
Last activity: Apr 13, 2025, 06:48 PM