[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Introduction for new users



In article <debian-user.m0xZm6G-000ZAPC@bobspc.SOMEWHERE>, you wrote:
> On Sun, 23 Nov 1997 22:08:14 +0000 "Oliver Elphick" <olly@lfix.co.uk>
> wrote: 
>  
> > You have to log in (as with Windows) by entering a username and password.
>                       ^^^^^^^^^^^^^^^
>      You don't log in with Windows 3.x, and I don't think you do with
> Windows95.  Did you mean WindowsNT? 

    Windows 95 can be set up with a weak idea of users, which can have
some of their own preferences.

>      In this connection, you might mention the desirability of
> aliasing potentially destructive commands to include the -i option,
> such as: 
>           alias rm='rm -i'
>           alias cp='cp -i'
>           alias mv='mv -i'

    This is generally considered a bad idea.  You will get used to them
and assume that these commands are safe.  One time you will be logged in
and the aliases will not be there for one reason or another and *poof*
there goes everything.  It is a much better idea to have wrappers around
dangerous functions that you get into the habbit of using.  If they
disappear or are unavailable (let's suppose you are on another system)
the worst that will happen is a command not found error.

I use the following zsh function, which could be trivially adapted to a shell
script or function in your favorite shell.

srm() {
    [[ $# -gt 0 ]] || {echo "Usage: srm file [file ...]"; return 1}
    for i in $*; do
	if [[ -f $i ]]; then 
	    echo $i
	    mv $i ~/.rm
	else
	    echo "$i cannot be removed."
	fi
    done
}

-- 
Aaron Denney


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: