linux shell two-level de-reference

来源:互联网 发布:网络电视怎么看中央台 编辑:程序博客网 时间:2024/05/15 06:48
#!/bin/sh

arr=("")
arr_backup=("")
v1="rt"
rt="hello"

func1()
{
   local att="att$1"
}

ttt="${!v1}"

echo "ttt = $ttt"


输出:

ttt=hello


在Makefile中

SYS=posix

SO_EXT=$(SO_$(SYS))

==> SO_EXT=$(SO_posix)


原创粉丝点击