I want to get the arg of a command from a var that has the index in it of the arg that I want.  Something like this# command in terminal, `foo -r -f value_wanted`index=3var=$$indexecho $var ## expected output `value_wanted`I know I can just call it by $3 but that index I have is in the variable.
get command line agrument by variable in shell script
bash;shell;shell script;command line;arguments
You can achieve that by using the following notation:echo ${!index}If you want to process positional arguments, I suggest to use getopt (not getopts), though.