Below is a sample code:
arg[1]="shell"
arg_value[1]=10
agr[2]="script"
agr_value[2]=50
command skbit ${agr[1]}="${arg_value[1]}" ${agr[2]}="${arg_value[2]}"
skbit is a script that accepts arguments in above format.
Now if there are multiple arguments that depends on the run time. How to create above command dynamically.
I tried with,
command skbit $str
where
str= ${agr[1]}="${arg_value[1]}" ${agr[2]}="${arg_value[2]}" and so on.
this structure is not working for command for multiple reason.
I want a code of below structure:
command skbit {A code which will generate arguments dynamically}
agrandarg? Whyarg_valueandagr_value?