我想将以下文本附加到Linux中的文件:
echo He said "I can't append this" >> file.txt
cat file.txt
He said I can't append this
Run Code Online (Sandbox Code Playgroud)
最好使用here-doc来避免疯狂转义:
cat<<'EOF' > file.txt
He said "I can't append this"
EOF
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
26 次 |
| 最近记录: |