On Thu, 15 Mar 2001, Vineeta wrote:

> If i try the alias as u gave:
> alias rm='mv $1 ./trashdir'
>
The example uses $HOME/trashdir, not ./trasdir - the difference is
important unless you have a trashdir directory in every directory where
you are going to use the rm command.
>
> ,it gives the foll. output :
> mv:cannot create directory 'testrm3': File exists
>
> What does it mean??I am puzzled...
> I am not telling it to create a dir. but it seems to try to create that dir.
> itself..?
>
> Vineeta
>
>
> Statux wrote:
>
> > can't you just do:
> >
> > alias rm='mv "$1" $HOME/trashdir'
> >
> > that's how I'd do it (at first)... but then I'd realise that I'd lose use
> > of rm.. so I'd have to change it around a lil.. I'd have to give my
> > altered deletion command a slightly different name:
> >
> > alias del='mv "$1" $HOME/trashdir'
> > alias rm='rm -i'
> >
> > the second line would make sure that if you accidentally use rm instead of
> > del, that you'd be prompted. Remember that the 'f' option overrides the
> > 'i' option. So doing 'rm -f' with the alias above, would actually be 'rm
> > -if'. The options cancel out.
> >
You should also make sure that ./trashdir exists if you are going to use
the alias the way you have it written.  Otherwise, the first time you
use your aliased rm command, it will remane the file to trashdir, and
the second time the results will depend on if you have file overwrite
protection turned on...

Mikkel
-- 

    Do not meddle in the affairs of dragons,
 for you are crunchy and taste good with ketchup.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to