<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://gentoo-zh.org/extern.php?action=feed&amp;tid=533&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / shell 变量的嵌套使用]]></title>
		<link>http://www.gentoo-zh.org/viewtopic.php?id=533</link>
		<description><![CDATA[shell 变量的嵌套使用 最近发表的帖子。]]></description>
		<lastBuildDate>Sun, 13 Nov 2022 10:05:44 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[shell 变量的嵌套使用]]></title>
			<link>http://www.gentoo-zh.org/viewtopic.php?pid=570#p570</link>
			<description><![CDATA[<p>需求</p><p>很多时候需要使用变量的值作为新变量，例如<br />kobe=24<br />name=&#039;kobe&#039;<br />#想通过name直接获取到24<br />#语义上也就是${${name}}，但是shell不支持这样的操作</p><p>此时可以使用eval命令，<br />[root@CentOS-7-2 ~]# name=&#039;kobe&#039;<br />[root@CentOS-7-2 ~]# kobe=24<br />[root@CentOS-7-2 ~]# eval echo &#039;$&#039;&quot;${name}&quot;<br />24<br />[root@CentOS-7-2 ~]#</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Sun, 13 Nov 2022 10:05:44 +0000</pubDate>
			<guid>http://www.gentoo-zh.org/viewtopic.php?pid=570#p570</guid>
		</item>
	</channel>
</rss>
