X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/613dfe05e23387248b2b163ebc2e064d26ceb80f..e45b0db3d66ca9e041622db3d801d026fb4d3724:/.zsh/zshrc/90_cleanfiles?ds=inline diff --git a/.zsh/zshrc/90_cleanfiles b/.zsh/zshrc/90_cleanfiles index 7bab8d4..faf5be7 100644 --- a/.zsh/zshrc/90_cleanfiles +++ b/.zsh/zshrc/90_cleanfiles @@ -2,7 +2,7 @@ # # remove files we never want to keep around # -# Copyright © 1994–2008 martin f. krafft +# Copyright © 1994–2017 martin f. krafft # Released under the terms of the Artistic Licence 2.0 # # Source repository: http://git.madduck.net/v/etc/zsh.git @@ -26,18 +26,19 @@ rmfiles+=~/nohup.out rmfiles+=~/typescript rmfiles+=~/jpilot.log rmfiles+=~/srtp.log +rmfiles+=~/hs_err_pid[0-9]*.log typeset -la _rmfiles -for f in ${~rmfiles[@]}; do +for f in ${~rmfiles}; do [[ -f $f ]] || continue _rmfiles+="$f" done -unset rmfiles -if [[ -n $_rmfiles ]]; then - info "Removing files: ${(j: :)${_rmfiles#$HOME/}}..." +if (( $#_rmfiles )); then + _rmfiles=(${_rmfiles#$HOME/}) + info "Removing files: ${_rmfiles[@]}..." rm -f ${_rmfiles[@]} fi