I want to execute a command in various images. I use a simple for
bash loop.
for i in `ls *.sif`
do
singularity exec $i cat /etc/os-release
done
I expect the script to print the os-release information for ALL images in that directory. Instead, it prints the information of the first one and it returns the prompt. If I run fg
command the command in the next image is executed, and so on. For n image, I have to run fg
command n-1 times.
Interestingly, if I replace the command with timeout 10 singularity exec $i cat /etc/os-release
, it would continue but it won't run the command inside the container.