# cat >>redhat.txt<<EOF I am libin EOF # cat >>redhat.txt<<EOF $LANG $PS1 EOF # cat >>redhat.txt<<'EOF' #'EOF' :不取变量的内容 $LANG $PS1 EOF # cat >>/etc/hosts<EOF lb01 10.0.0.1 lb02 10.0.0.2 web01 10.0.0.3 EOF 注:#EOF:结束的标记,可以自定义