I am trying to automate a python using bash which is as follows. I am using a loop in bash to provide a second argument to the python but up to no avail. I am getting index out of range for the python file. The code and error are below
#!/bin/bash
$input_file=$1
echo $1
for ((i = 2 ; i < 3 ; i++ ));
do
echo $i
python extract_random_columns.py $input_file $i
done
Error:
./create_dataset.sh: line 2: =../data/ind_input_n_500_d_25_skyd_100.txt: No such file or directory
../data/ind_input_n_500_d_25_skyd_100.txt
2
2
Traceback (most recent call last):
File "extract_random_columns.py", line 8, in <module>
num_of_columns = int(argv[2])
IndexError: list index out of range