I am writing a small script in shell and I have a constant in upper cases as you can see in code ('PRIX'). My problem is, I would like to print the value of the constant using the variable that will be equal to the string ('PRIX'). I won't explain you why as it would be useless, but that would cut my entire code in half and simplify everything.
readonly _PRIX_=7
.
.
.
function trier {
#here it starts
#function call, change 'option' value for "_PRIX_"
option=$(equivalence "$option")
#HERE The line I need to fix to print '7'
echo $'$option'
#Print '7', What I wanna recreate knowing 'option' value=="_PRIX_"
echo $_PRIX_
sort -t$":" -k'$option' "$le_depot"
}