bashdockershellsingularity-container

Run next command in script after invoking singularity shell


I have a shell script with multiple singularity commands in it myscript.sh

#!/bin/sh/

singularity shell -B /home/user/Desktop/ /home/user/image/some_image.simg
/home/user/miniconda/activate my_env
cd /app/app_folder/scripts
ls -ash

when i run the script it get stuck after the shell is invoked.

singularity>

However I want the subsequent commands to run in the invoked shell. How do I go about this?


Solution

  • YOu are connecting to an interactive command shell inside a shell script, what you need is only execute the commands.

    singularity exec ...
    

    https://sylabs.io/guides/3.7/user-guide/cli/singularity_exec.html