Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这与 clobber / noclobber 功能相反。如果文件已经存在,我只想更新它。我知道我可以使用多个命令来做到这一点,但是是否有一个操作员可以做到这一点?
我能想到的最接近的是[[ -f "$filename" ]] && do something > "$filename"
[[ -f "$filename" ]] && do something > "$filename"
我 RTFMed 和运营商还不存在。