- Code: Select all
# echo "2nd Overwritten content">tmp.file
bash: tmp.file: cannot overwrite existing file
First option would be to disable the noclobber variable:
- Code: Select all
# set +o noclobber; set -o | grep nocl
noclobber off
The second option is to use the pipe (|)right after the redirection sign:
- Code: Select all
# echo "2nd Overwritten content" >| tmp.file
# cat tmp.file
2nd Overwritten content


News