The shell uses the value of the variable to get the value of a new variable name

The shell uses the value of the variable to get the value of a new variable name

#!/bin/bash
name='xiaoke'
xiaoketest='123'

echo `eval echo '$'"${name}test"`

result:

will output 123

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324794798&siteId=291194637