79466376

Date: 2025-02-25 11:23:02
Score: 1
Natty:
Report link

Use printenv available in most of the linux distros. Simply run

printenv ${VAR_PREFIX}_VARNAME

NOTE: One disclaimer is that the actual variable needs to be exported.

So for this example:

export VAR_PREFIX=some_prefix
export some_prefix_VARNAME=some_value
printenv ${VAR_PREFIX}_VARNAME

result is:

some_value
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Damian Kokot