On Wed, 14 Mar 2001, John Weber 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..
>
> A command that has been aliased can be executed as the original system
> version by preceding it with a backslash.

or by putting it in quotes, as in

$ "rm" file

  in fact, if you're a shell programmer, this is a useful trick that
lets you override shell builtins with shell functions.  consider
writing a "better" cd command using a function:

function _cd {
        more ./.exit
        "cd" $1
        more ./.enter
}

alias cd=_cd

  from now on, you can just type:

$ cd <dirname>

on the way out of the current directory, the function prints the
contents of an "exit file", changes directory, then prints the contents
of an "enter file", so you can set up ftp-like welcome messages on a
per-directory basis.

rday

-- 
Robert P. J. Day
Eno River Technologies, Durham NC
Unix, Linux and Open Source training


"This is Microsoft technical support.  How may I misinform you?"



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

Reply via email to