diff --git a/bashrc-alice.sh b/bashrc-alice.sh index a3b93aa..f0e1c72 100644 --- a/bashrc-alice.sh +++ b/bashrc-alice.sh @@ -89,5 +89,5 @@ debug-o2-compile() { # Find runtime error messages in an execution log. debug-o2-run() { [ "$1" ] || { echo "Provide a log file"; return 1; } - grep -n -e "\\[ERROR\\]" -e "\\[FATAL\\]" -e "\\[CRITICAL\\]" -e "segmentation" -e "Segmentation" -e "SEGMENTATION" -e "command not found" -e "Program crashed" -e "Error:" -e "Error in " -e "\\[WARN\\]" -e "Warning in " "$1" + grep -n -e "\\[ERROR\\]" -e "\\[FATAL\\]" -e "\\[CRITICAL\\]" -e "segmentation" -e "Segmentation" -e "SEGMENTATION" -e "command not found" -e "Program crashed" -e "Error:" -e "Error in " -e "failed" -e "\\[WARN\\]" -e "Warning in " "$1" } diff --git a/bashrc-server-admin.sh b/bashrc-server-admin.sh index 46aace2..e7fba19 100644 --- a/bashrc-server-admin.sh +++ b/bashrc-server-admin.sh @@ -78,7 +78,7 @@ inactive-users-size() { memory-ok() { [ "$1" ] || { echo "Provide the minimum memory fraction"; return 1; } frac_min="$1" - return "$(free | grep Mem | awk -v frac_min="$frac_min" '{print ($7 < $2 * frac_min) ? 1 : 0}')"; + return "$(free | awk -v frac_min="$frac_min" 'FNR == 2 {print ($7 < $2 * frac_min) ? 1 : 0}')"; } # Show n_proc processes taking the most memory. diff --git a/clean-tmp.sh b/clean-tmp.sh index e8c3331..f13ca85 100755 --- a/clean-tmp.sh +++ b/clean-tmp.sh @@ -14,7 +14,7 @@ sudo apt clean echo "Moving files to trash bin" gio trash -f \ "$HOME"/.aliensh_history \ -"$HOME"/.bash_history \ +"$HOME"/.bash_history* \ "$HOME"/.cache/doublecmd/thumbnails/* \ "$HOME"/.cache/mintinstall/screenshots/* \ "$HOME"/.cache/thumbnails/*/*.png \ diff --git a/shreddir.sh b/shreddir.sh index 8583d7d..8ea2f73 100755 --- a/shreddir.sh +++ b/shreddir.sh @@ -5,6 +5,6 @@ [ -d "$1" ] || { echo "Directory $1 does not exist"; exit 1; } echo "Shredding directory: $1" -find "$1" -depth -type f -exec "$(dirname "$(realpath "$0")")"/shred.sh {} \; && rm -rf "$1" +find "$1" -depth -type f -exec "$(dirname "$(realpath "$0")")"/shred.sh {} \; exit 0