Commit 7a986b3a authored by Klaatu von Schlacker's avatar Klaatu von Schlacker
Browse files

drops support for spaces in filenames cuz it breaks wildcards and ability to...

drops support for spaces in filenames cuz it breaks wildcards and ability to trash multiple files. also ensures empty deletes hidden files in trashcan
parent 8cb1d1f5
......@@ -7,6 +7,9 @@ thereafter started cursing God, UNIX, GNU, computers, and yourself.
Never fear. There is hope.
Well, not for your deleted file -- that's gone. Sorry. But from
now on, you'll never have to go through that ever again!
2. Usage
......@@ -46,16 +49,31 @@ alias helps. To have an alias installed along with trashy, simple
uncomment the alias block in the install.sh script.
4. System Integration
4. Ditching the Alias
Eventually it will become tedious to you to work around the trash
command every time you really really do want to rm a file. At that
point, you'll probably want to get rid of the alias.
Personally, I maintain an rm='rm -i' alias in ~/.bash_aliases just to
avoid any initial mishaps.
And then eventually I got rid of any aliasing so that the commands
were all really what they appeared to be. rm to delete permanently,
trash to move to a trash bin. It WILL take a while, if you're used to
rm, so do account for that.
5. System Integration
I plan on integration trashy with the freedesktop.org Trash
I would love to integrate trashy with the freedesktop.org Trash
http://www.ramendik.ru/docs/trashspec.html
But for now, we have the hack you see now.
5. Why trashy?
6. Why trashy?
Trashy is BASHy, meaning that it's really really portable. It can be
installed easily on GNU Linux, freeBSD, and Mac OS X. Probably more,
......@@ -71,4 +89,26 @@ really neat and fancy features and probably already conforms to Free
Desktop specs. Check it out if you're on a Linux box or if you don't
mind a bit of set-up on non Free Desktop UNIX systems.
http://code.google.com/p/trash-cli/
\ No newline at end of file
http://code.google.com/p/trash-cli/
7. Bugs
Yes, there is one glaring horrible bug: trashy does not support
files with a SPACE in its name. You can try to fool trashy with
quotes and wildcard characters, but I can't iron it out. I can
give you support for wildcards. Or I can give you support for
spaces. But not both.
Since spaced filenames are uncommon on my systems and on many
production servers that I've seen, or on any web dev's system,
I opted to drop support for spaces. This means we get to keep
support for wildcard characters and the ability to trash more
than one file at a time. Rather a nice feature, imho.
So if you know the secrets to supporting multiple args, some with
spaces in the names, others with wildcards, then do submit a patch.
I can generally be contacted via klaatu
at the domain of member dot fsf
dot org.
......@@ -21,8 +21,10 @@ ARG="$1"
if [ "X$ARG" == "X-v" ]
then
/bin/rm -rvf ~/.trash/*
/bin/rm -rvf ~/.trash/* 2> /dev/null
/bin/rm -rvf ~/.trash/.* 2> /dev/null
else
/bin/rm -rf ~/.trash/*
/bin/rm -rf ~/.trash/* 2> /dev/null
/bin/rm -rf ~/.trash/.* 2> /dev/null
fi
echo "Your trash is now empty."
......@@ -32,7 +32,7 @@ if [ "X$ARG" == "X.trash" ]
else
if [ "X$ARG" != "X" ]
then
mv -b "$ARG" ~/.trash/"$ARG"_$(date | cut -f 2-5 -d ' ' | tr ' ' '_' | tr ':' '.') || exit 1
for junk in $ARG; do mv -b $junk ~/.trash/$junk_$(date | cut -f 2-5 -d ' ' | tr ' ' '_' | tr ':' '.') || exit 1 ; done
# useless user friendly reassuring fluffy stuff
RETURN="$ARG"
if [ "X$2" != "X" ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment