WELCOME TO TRASH!!!
Copyright (C) 2003, 2004 Jason R. Looker
Department of Mathematics and Statistics
The University of Melbourne
Victoria 3010
AUSTRALIA
E-mail: j.looker@ms.unimelb.edu.au
See the COPYING file for copyright and warranty details.
If you are upgrading trash, see the CHANGELOG file for
upgrading instructions.
* TRASH SYSTEM REQUIREMENTS AND INSTALLATION INSTRUCTIONS
* SYSTEM REQUIREMENTS
1) trash requires a Linux/Unix/Mac OS X style operating system with
BASH version 2.0 or newer. Type
bash --version
to find out which version of BASH is on your system.
NOTE: trash can be run from within any shell.
* INSTALLATION INSTRUCTIONS
The installation of any shell script involves five steps:
1) locating the path of the interpreter;
2) choosing a directory to store the script;
3) making the script executable;
4) moving the script to the directory where it's to be stored;
5) updating the command hash table.
If you are familiar with installing shell scripts, then you should
only need to read step 2) of the below instructions. Otherwise read
on ...
To begin, change directories to the trash directory:
cd ~/downloads_directory/Trash_Dir
1) LOCATING THE PATH OF THE INTERPRETER
The first line of trash tells your shell to interpret
trash in BASH. Currently the first line of trash reads
#! /bin/bash
however, BASH may not be in the /bin directory on your
system. To work out where BASH is on your system, type
which bash
If you see
/bin/bash
then you DO NOT need to alter trash. If you don't see
this, then you will need to change the first line of trash
to the appropriate location. For example, if bash is located at
/usr/local/bin/bash
then the first line of trash needs to be changed to
#! /usr/local/bin/bash
2) CHOOSING A DIRECTORY TO STORE THE SCRIPT
trash should be placed in a directory named "bin". There are
essentially two choices:
i) Install trash in ~/bin. If you choose this option then you will
be the only user able to run trash.
ii) Install trash in one of the "usual" locations such as
/usr/local/bin. If you choose this option, then trash can support
multiple users.
I recommend you install trash into /usr/local/bin for the
following reasons:
- if you are not the only user of your computer or you do not own
your computer, then someone else may want to use trash in the
future;
- /usr/local/bin should appear before ~/bin in your PATH, so trash
will start up (marginally) quicker;
- /usr is owned by root, this will minimize the chance of any accidental
changes to trash.
Since /usr is owned by root, you will not be able to make any
changes to the contents of /usr unless you are an "administrator"
of your computer. If you do not have administrator status, then you
will have to install trash into ~/bin.
BEFORE PROCEEDING, CHECK THAT THE DIRECTORY IN WHICH YOU INTEND TO
INSTALL TRASH IS CURRENTLY IN YOUR SEARCH PATH. Type
echo $PATH
to check. If it is not, then see the PATH file for instructions on
how to add a directory to your PATH.
3) MAKING THE SCRIPT EXECUTABLE
To make trash executable, type
chmod a+x trash
4) MOVING THE SCRIPT
Copy trash to the directory in which it's to be stored, for example,
if you wish to install trash into /usr/local/bin, then type
sudo cp -i trash /usr/local/bin/trash
NOTE: if you are installing trash into ~/bin, then omit the sudo
command.
NOTE: you will need to enter your password and you will need
"administrator" status to successfully complete the sudo command.
If you do not have administrator status then you must install
trash into ~/bin.
5) UPDATING THE COMMAND HASH TABLE
There are two methods of updating the command hash table:
i) Use a command. The command you use depends on what your default
shell is. Type
echo $SHELL
to find out which shell you are using. If you are using the Bourne
shell or BASH, type
hash trash_path
where trash_path is trash's full path. If you are using CSH or
TCSH, type
rehash
NOTE: the (re)hash command must be executed in each terminal that was
launched before you installed trash.
ii) Close all terminals (if it is safe to do so). This is often much
easier than the first option.
trash is now installed.
* RECOMMENDATION
To make trash easier to use, I recommend that an alias be created for
each mode of the trash command. For example, instead of trash you
could use the following:
mvtr (alias for trash -m)
lstr (alias for trash -l)
rmtr (alias for trash -r)
gettr (alias for trash -g)
cdtr (alias for cd ~/.Trash).
To create these short cuts, and assuming that you've installed trash into
~/bin, ...
For TCSH (CSH) users, add the following to your ~/.tcshrc (~/.cshrc) file:
alias mvtr '~/bin/trash -m'
alias lstr '~/bin/trash -l'
alias rmtr '~/bin/trash -r'
alias gettr '~/bin/trash -g'
alias cdtr 'cd ~/.Trash'
For BASH users, check that the following (or something similar) appears in
~/.bash_profile OR ~/.bash_login OR ~/.profile (in that order):
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
then add the following to your ~/.bashrc file:
alias mvtr='~/bin/trash -m'
alias lstr='~/bin/trash -l'
alias rmtr='~/bin/trash -r'
alias gettr='~/bin/trash -g'
alias cdtr='cd ~/.Trash'
For SH users, add the following to your ~/.profile file:
alias mvtr='~/bin/trash -m'
alias lstr='~/bin/trash -l'
alias rmtr='~/bin/trash -r'
alias gettr='~/bin/trash -g'
alias cdtr='cd ~/.Trash'
* Type trash -h for more information.
______________________________________________