# set -o noclobber
# touch test
# echo "a" > test
ksh: test: file already exists
# set +o noclobber
# echo "a" > test
# cat test
a
#
若要不取消同时又要可覆写:
#set -o noclobber
#touch test
#echo "a" >| test
强行覆盖目标文件,也就是说目标文件的内容被永久改变
注意:>和|之间不能有空格
阅读(3546) | 评论(0) | 转发(0) |