0

I want to run a python script which is parsed from a bash file. When I try to run it, I get errors everywhere and I do not know what the issue could be. Any help?

The bash script (run_dmd_atomic.sh) looks like this:

#!/bin/bash

BATCH_SIZE=${1}
CODE_LENGTH=${2}
EPOCHS=${3}
SP=${4}
A1=${5}
A2=${6}
A3=${7}

srun python3 dmd_solver.py \
--batch_size ${BATCH_SIZE} \
--code_length ${CODE_LENGTH} \
--epochs ${EPOCHS} \
--sp ${SP} \
--a1 ${A1} \
--a2 ${A2} \
--a3 ${A3} \

The error I get is:

[tmarta@eu-login-09-ng training]$ ./run_dmd_atomic.sh
./run_dmd_atomic.sh: line 20: srun: command not found
user11400799
  • 143
  • 1
  • 3
  • 10

1 Answers1

0

In bash script, no white space is allowd in variable assignment expression. Otherwise, bash interpret it as a command or excutable. Your error log is pointing out that.

For example, in your script

BATCH_SIZE = ${1}

should be

BATCH_SIZE=${1}
Seong
  • 556
  • 4
  • 18