Bash: user select one of the several options, how to assign new value to selected option inside the loop?

Hello in bash user selects one of the several options and then i want to assign new value to that option.

echo "Select option:" && select category in Downloads Videos Music; do
Downloads="$HOME/Downloads/"
Videos="$HOME/Videos/"
Music="$HOME/abc/Music/"
echo "$category"
done

I want that echo to show the path not the option name. How to do it please?

Use ${!category} instead of "$category"

1 Like

Thank you very much, it worked! I wish i can remember it.

1 Like

@postcd You’re welcome. :grin: :+1: