我知道以下代码在/ opt/hadoop/conf目录中创建了一个文件core-site.xml。有人可以为我分解在Linux shell的条款?尤其是< <运营商& CORE_EOF?这些标记如何工作?我有点理解这一点,但想更好地了解。“<<”运算符在linux shell中如何工作?
cat >/opt/hadoop/conf/core-site.xml <<CORE_EOF
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:8020</value>
</property>
</configuration>
CORE_EOF
请参阅http://www.gnu.org/software/bash/manual/bashref.html它是一个“HEREDOC”。 – 2012-08-28 22:40:31
这被称为[here document](http://tldp.org/LDP/abs/html/here-docs.html)。哪一部分你不明白。 –
@larsmans涉及查看手册中的部分,我怀疑;-) – 2012-08-28 22:41:46