'Passing bash variable as an argument to python argument parser from slurm batch file [duplicate]

BETON_FILE_NAME = "testfile2"

srun $pythonExec write_beton.py --mode 'xxx' \
                                --labeled_file_path 'yyy' \
                                --beton_file_name $BETON_FILE_NAME \
                                --description 'zzz'

I am running a python script from slurm batch file and passing arguments through argument parser. I am trying to pass a bash variable as an argument to python script and it is giving the following error

write_beton.py: error: argument --beton_file_name: expected one argument



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source