Home > other >  Is the sharp something format common in bash?
Is the sharp something format common in bash?

Time:05-18

This may be a duplicate or too naive a question but I couldn't find the proper keywords to search on Google. I'm learning from some example bash scripts for jobs using SGE and SLURM and I couldn't completely figure out the logic behind this. In a script for SGE, we have

#$ -cwd             # Current working directory
#$ -N JobTest1      # Name of submitted job

and for SLURM, we have

#SBATCH --job-name=JobTest1
#SBATCH --output=TestOutput.log

I understand that if your qsub or sbatch the script, the stuff after #$ or #SBATCH will be passed to the command as arguments. Is it generally true for other commands in bash or Linux? If so, will they have their own required format for doing this (i.e. # SometingElse)?

Also, I noticed that the ways values passed to the arguments are different. In the first case, there is a space between the flag and the value, but in the latter case, there is an equal sign. Are these specific to the SGE or SLURM modules or these styles are interchangeable?

CodePudding user response:

This is very specify to how resource managers like Slurm, PBS, SGE, etc. work and you should not expect other software to work like that.

As for the equal sign, that question is more generic and applies to most Linux software, you will find a good answer here.

  • Related