On Fri, 16 Mar 2001, Vineeta wrote:
>
>
> "Mikkel L. Ellertson" wrote:
>
> > On Thu, 15 Mar 2001, Vineeta wrote:
> > >
> > > I am only trying this in my home directory i.e. /home/vineeta.
> > > under vineeta dir.,i have a dir. called trashdir.
> > > Now,my script lies in /home/vineeta
> > >
> > > So,what's going wrong with alias rm='mv $1 ./trashdir' ??
> > > As statux put it,use "$1" in quotes.
> > > I missed out this.But,what's the difference.
> > >
> > > Now,if i try out what statux says i.e. alias rm='mv "$1" $HOME/trashdir"
> > > ,i get:
> > >
> > > mv: when moving multiple files,last arguement must be a directory.
> > >
> > > Vineeta
> > >
> > >From the error message, the file you are trying to delete is not realy a
> > file, but a directory, and trashdir is realy a file, not a directory.
> >
> > What does "file trashdir" return. Also, what does file say about the
> > file name you are using when trying your new rm command?
> >
> > Mikkel
> > --
>
> Hi Mikkel,
>
> The command:
> file trashdir
> returns:
> trashdir: directory
>
> About the new "rm" command,i am using it only as an alias on the prompt.
> i am not using it in a file.
>
> i am only using the following:
> alias rm='mv "$1" $HOME/trashdir'
>
> that's it.on command line.
> the error i get when i say:
> rm testrm1
>
> is:
> mv: when moving multiple files,last arguement must be a directory.
>
> However,i just tried something new :
> alias rm='cat $1 >testall'
>
> after that when i try:
> rm testrm1
> (where testrm1 is a file i want to delete)
>
> It succesfully overwrite the contents into the file testall.
> IS it that mv and cp require something more..?
> Am really puzzled.
>
> Vineeta
>
>
I finely had time to play around with this. Doing it as an alias does
not work - the file name is not passed to the alias as $1. But I did
create a function that works.
rm ()
{
mv $@ $HOME/trashdir
}
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