I need to implement the following psudo code using bash.
tmp_1=""
tmp_2=""
for var in "arg_list"
do
if[var is eq to "str_1"]
do
var++ # shift the loop iter to next argument
tmp_1 = var # assign the next string/argument to 'tmp_1' variable
done
done
eg: if i run my bash script as follow, then the value of tmp_1 should be 'str_2'
<my_script> str_1 str_2
I try to do this with 'shift' in bash, but it didn't work to me. how to do this implementation?