From 44b3978da4ffcc8a1b4c92dfeaef2161319d2779 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Thu, 21 Aug 2014 14:15:08 -0400 Subject: [PATCH] better printing in safedel for the deleted file list, added 'line' alias for printing a separator line to the console. --- customizing/fred/fred_common.alias | 18 +++++++++++++++--- scripts/files/safedel.pl | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/customizing/fred/fred_common.alias b/customizing/fred/fred_common.alias index 84d5fe14..5a0f94e2 100644 --- a/customizing/fred/fred_common.alias +++ b/customizing/fred/fred_common.alias @@ -6,12 +6,24 @@ alias moo='check_mount /z/stuffing ; check_mount /z/walrus ; check_mount /z/chunky ; check_mount /z/fredgrid' alias unmoo='sudo umount /z/stuffing ; sudo umount /z/walrus ; sudo umount /z/chunky ; sudo umount /z/fredgrid' -# cleans up the ownership for all my files. -#moved alias refred='(chown -R fred:fred /home/fred /home/games /home/archives ; normal_perm /var/log )' - # skype needs this to run properly. alias skype='env PULSE_LATENCY_MSEC=30 skype' # load in the xsede build scripts. source "$FEISTY_MEOW_SCRIPTS/buildor/build_xsedes.sh" +# just shows a separator line for an 80 column console, or uses the first +# parameter as the number of columns to expect. +function line() +{ + count=$1; shift + if [ -z "$count" ]; then + count=80 + fi + echo + for ((i=0; i < $count - 1; i++)); do + echo -n "=" + done + echo + echo +} diff --git a/scripts/files/safedel.pl b/scripts/files/safedel.pl index 14aca014..3892cb64 100644 --- a/scripts/files/safedel.pl +++ b/scripts/files/safedel.pl @@ -115,14 +115,14 @@ sub safedel { # remove the directory itself if possible, since zip did not. &recursively_zap_dirs($file); } - push(@deleted, "$file"); + push(@deleted, "\"$file\""); } elsif (-f $file) { # store the file in the trash storage. system("chmod u+rw \"$file\""); #print "about to run: system [$zip -m$use_path $tempfile '$file' $DEV_NULL]"; system("$zip -m$use_path $tempfile \"$file\" $DEV_NULL"); - push(@deleted, "$file"); + push(@deleted, "\"$file\""); } else { print "$0 cannot find \"$file\" to delete it.\n"; } -- 2.34.1