he.txtbash:he.txt:cannotoverwriteexistingfile如果要取消限制,就把set-o改為set+o[root@stu227he]#set+onoclobber[root@stu227he]#echo"123">he.txt[root@stu227he]#c"/> he.txtbash:he.txt:cannotoverwriteexistingfile如果要取消限制,就把set-o改為set+o[root@stu227he]#set+onoclobber[root@stu227he]#echo"123">he.txt[root@stu227he]#c">

首頁  >  文章  >  系統教程  >  CentOS檔案覆蓋問題的解決方法

CentOS檔案覆蓋問題的解決方法

王林
王林轉載
2024-01-03 16:34:24598瀏覽

[root@stu227 he]# touch he.txt

#[root@stu227 he]# set -o noclobber

[root@stu227 he]# echo "123" > he.txt

#bash: he.txt: cannot overwrite existing file

如果要取消限制,就把set -o 改為set o

[root@stu227 he]# set o noclobber

#[root@stu227 he]# echo "123" > he.txt

#[root@stu227 he]# cat he.txt

#123

以上是CentOS檔案覆蓋問題的解決方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:jb51.net。如有侵權,請聯絡admin@php.cn刪除