Hi I am new to bash scripting, trying to read a text file that contains my ids and want to use it in a loop by saving it to a $variable
and using that for fetching some data.
#!/bin/bash
file = "Cell_ids.text"
i=1
for i in file; do
i=$((i+1))
**id** = **$i**
sbatch --mem=4G --time=100 -o fetch_data.%j.out -e fetch_data.%j.err -J fetch_data <<EOF
#!/bin/bash
java -jar /docs/some-tools.jar --library ${**id**}
EOF
for i in $(cat file)
is a bad idea: mywiki.wooledge.org/BashPitfalls#for_f_in_.24.28ls_.2A.mp3.29.