用eval来实现: # a=hello # b=world # for i in a b; do eval echo '$'"${i}"; done hello world 转载请注明:liutianfeng.com » SHELL变量嵌套 喜欢 (0)