Shell中EOF的用法舉例

含義

End Of File:自定義文件終止符

輸出多行到控制檯
cat << EOF
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
EOF
輸出多行到文件

輸出多行到/home目錄下limits.conf文件,如果該文件沒有,會新建。

cat >> /home/limits.conf <<EOF
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
EOF
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章