shell脚本中cat EOF1的意思

版权声明:如若转载,请联系作者。 https://blog.csdn.net/liu16659/article/details/85226897

shell脚本中cat <<EOF1 的意思

1. 什么是EOF?

EOF就是end of file

2. cat <<EOF1

cat <<EOF1 的意思就是查看直到EOF1的内容,示例如下:

2.1 示例1
[root@server4 temp]# cat <<EOF1
> sdf
> dsfs
> dfsoj
> EOF1
sdf
dsfs
dfsoj
2.1 示例2

同时,我们可以将这些查看的内容,追加到一个文本中,如下:

[root@server4 temp]# cat <<EOF1 > index.html
> a
> b
> c
> d
> hadoop 
> spark
> scala
> java
> EOF1
[root@server4 temp]# cat index.html 
a
b
c
d
hadoop 
spark
scala
java

猜你喜欢

转载自blog.csdn.net/liu16659/article/details/85226897