Linux 基礎 – 使用 cat 建立檔案

# cat shell/catfile.sh
#!/bin/bash
cat <<EOF >log.txt
LOG FILE HEADER
This is a test log file
Function: System statistics
EOF

更改權限
# chmod 700 shell/catfile.sh

執行
# shell/catfile.sh

看成果
# cat shell/log.txt
LOG FILE HEADER
This is a test log file
Function: System statistics