]> code.delx.au - dotfiles/commitdiff
bash: Don't allow stdout redirection to overwrite existing files
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 7 Mar 2016 06:52:55 +0000 (17:52 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 7 Mar 2016 06:55:40 +0000 (17:55 +1100)
.bash/interactive

index 88d6f34ae3ba2dc67a82a51729db9713ce9d4935..cc4ca57eb9e4565a211d989710aba8ad6f23236c 100644 (file)
@@ -167,7 +167,8 @@ shopt -s checkwinsize
 # Don't attempt to tab-complete an empty line
 shopt -s no_empty_cmd_completion
 
-
+# Prevent overwriting existing files on stdout redirection
+set -o noclobber
 
 # Local customisations
 [ -r "${HOME}/.bash/interactive_local" ] && source "${HOME}/.bash/interactive_local"