在shell中
'>' 为创建: echo “hello shell” > out.txt
'>>' 为追加:echo “hello shell” >> out.txt
当out.txt 文本不存在时,'>'与‘>>’都会默认创建out.txt文本,并将hello shell 字符串保存到out.txt中
当out.txt文本存在时,‘>’会将out.txt文本中的内容清空,并将hello shell 字符串存入
而‘>>’会将 hello shell追加保存到out.txt的末尾
在shell中
'>' 为创建: echo “hello shell” > out.txt
'>>' 为追加:echo “hello shell” >> out.txt
当out.txt 文本不存在时,'>'与‘>>’都会默认创建out.txt文本,并将hello shell 字符串保存到out.txt中
当out.txt文本存在时,‘>’会将out.txt文本中的内容清空,并将hello shell 字符串存入
而‘>>’会将 hello shell追加保存到out.txt的末尾
本文标题:shell [IO处理]中 '>' 与‘>>’ 的区别
本文链接:https://www.haomeiwen.com/subject/xrnlmqtx.html
网友评论