💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] 参考连接:[https://blog.csdn.net/h363659487/article/details/82776100](https://blog.csdn.net/h363659487/article/details/82776100) ## **cat 实现新建文件并新增内容** ``` root@iZwz9ip2vahucgvexpgvsmZ:/opt# cat << EOF >abcd.txt > 1 > 2 > 3 > eof > EOF root@iZwz9ip2vahucgvexpgvsmZ:/opt# cat abcd.txt 1 2 3 eof ``` ## **cat >实现已有文件并追加内容** ``` root@iZwz9ip2vahucgvexpgvsmZ:/opt# cat <<EOF>> abcd.txt > 4 > 5 > 6 > EOF root@iZwz9ip2vahucgvexpgvsmZ:/opt# cat abcd.txt 1 2 3 eof 4 5 6 ``` ## **在SHELL脚本中使用cat 进行环境变量设置:** ``` cat <<EOF >/etc/profile.d/goroot.sh export GOROOT=$GOROOT export GOPATH=$GOPATH export PATH=\$PATH:$GOROOT/bin:$GOPATH/bin EOF ```