I'm looking for using inputs in the shell prompt by way of SLURM . For example, when I use a simple bash script like :
#!/bin/bash
echo What\'s the path of the files?
read mypath
echo What\'s the name you want to give to your archive with the files of $mypath?
read archive_name
echo Ok, let\'s create the archive $archive_name
for i in $mypath/*;
do if [[ -f $i ]]; then
tar -cvf $archive_name $mypath/*;
fi;
done
And I use in the prompt :
bash my_script.sh
What's the path of the files?
/the/path/of/the/files
What's the name you want to give to your archive with the files of $mypath?
my_archive.tar
And it creates the archive my_archive.tar
. But now, I have to use that script with SLURM. When I use sbatch my_script.sh
, that automatically submits the script in a job and I can't add my inputs : /the/path/of/the/files
and my_archive.tar
Any idea?