Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use CVS to synch login scripts, etc. amongst machines' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use CVS to synch login scripts, etc. amongst machines
Authored by: klktrk on Nov 19, '03 01:32:03PM

I've been doing this for about a year now. It's paradise! In my .bash_profile I have a case statement for just those customizations that are specific to each host I work on, and then the rest of the script contains universal settings, functions, preferences, one of which is my command line implementation of a trash can, as follows:
TRASHCAN="$HOME/.Trash"

function trash () {
if [ ! -e $TRASHCAN ];then
mkdir $TRASHCAN
fi
for F in $@;do
mv -v $F $TRASHCAN
done
diskusage=`du -hs $TRASHCAN | cut -f 1`
echo "$diskusage in trash"
}
function emptytrash () {
if [ -e $TRASHCAN ];then
mkdir $TRASHCAN
wd=`pwd`
cd $TRASHCAN
for F in `ls -A $TRASHCAN`;do
echo "Shredding $F..."
shred -fuz $F
done
echo "Trash has been shredded."
cd $wd
else
echo "Trash can is empty."
fi
}

Now, instead of 'rm filename', I type 'trash filename'. It's a little safer, and I just empty the trash every week or so



[ Reply to This | # ]