开发者社区 问答 正文

追加有哪两种格式可以使用呢?

已解决

追加有哪两种格式可以使用呢?

展开
收起
酸不李子 2022-04-01 23:05:57 663 分享 版权
1 条回答
写回答
取消 提交回答
  • 推荐回答

    格式一

    #!/bin/bash

    cat << EOF >> /root/test.txt

    Hello!

    My site is www.361way.com

    5.My site is www.91it.org

    Test for cat and EOF!

    EOF

    格式二

    #!/bin/bash

    cat >> /root/test.txt <<EOF

    Hello!

    My site is www.361way.com

    5.My site is www.91it.org

    Test for cat and EOF!

    EOF

    2022-04-29 21:33:54
    赞同 展开评论
问答地址: