#!/bin/bash while getopts ":i:s:" opt; do case $opt in i) iter=$OPTARG echo "fitting $OPTARG iterations " >&2 ;; l) l_index=$OPTARG echo "each consisting of $OPTARG*10^5 events" >&2 ;; m) mother_index_fit=$OPTARG echo "plotted in a histogram of $OPTARG bins" >&2 ;; \?) echo "invalid option: -$OPTARG" >&2 exit 1 ;; :) echo "Option: -$OPTARG requires an argument." >&2 exit 1 ;; esac done for ((index = 1; index< $iter; index+=1)); do python BDTselect_and_fit.py -x_cut $(( 0)) -iteration $(( $iter)) -l_index $(( $l_index)) -mother_index_fit $(( $mother_index_fit)) done