Re: Restoring /etc/inittab

2004-05-17 Thread Wilko Fokken
On Thu, May 13, 2004 at 09:09:29AM +0200, Pierg75 wrote:
> Adam Funk wrote:
> >On Wednesday 12 May 2004 17:40, Pierg75 wrote:
> >>Somewhere i read that an alias should never be an alias of itself,
> >>something like alias rm='rm -i'
> >alias ls='ls --color=auto'
> >alias rm='rm -vi'
> >alias cp='cp -vi'
> >alias mv='mv -vi'
> >alias cal='cal -3m'  # week starts on Monday
> >
> >and I'm sure I got this idea from some reputable Unix books.  This way
> >rm always asks *except* when you use -f.
> 
> It works for sure, because somewhere i use it too.
> I was meaning about the comcept:
> because if you get use of this approach, when you go to work on a 
> machine that doesn't have this alias, immagine what you coul do if you 
> write rm /etc/apache/* because you are sure (or you don't pay 
> attention) that would ask you to confirm.
> Since i read that article (it was on a magazine), i try to don't use 
> this kind of aliases and to pay more attention on what i'm doing.
> 


Hello,

within bash, you could use an alternate kind of aliases in order to
circumvent any reentrance problem under a different OS:

alias rm='/bin/rm -vi'
or
alias cd="builtin cd ${CDHOME}"

-- 
Wilko Fokken   Education is a man's going
Landschaftspolder 67   from cocksure ignorance
D-26831 Dollartto thoughtful uncertainty.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Restoring /etc/inittab

2004-05-13 Thread Adam Funk
On Thursday 13 May 2004 08:20, Pierg75 wrote:

> It works for sure, because somewhere i use it too.
> I was meaning about the comcept:
> because if you get use of this approach, when you go to work on a
> machine that doesn't have this alias, immagine what you coul do if you
> write rm /etc/apache/* because you are sure (or you don't pay
> attention) that would ask you to confirm.
> Since i read that article (it was on a magazine), i try to don't use
> this kind of aliases and to pay more attention on what i'm doing.

That's a good point.  I try to mitigate this problem is by setting these
up immediately in ~/.bashrc or .tcshrc when I get an account on a new
computer.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Restoring /etc/inittab

2004-05-13 Thread Pierg75
Pierg75 wrote:
because if you get use of this approach, when you go to work on a 
machine that doesn't have this alias, immagine what you coul do if you 
write rm /etc/apache/* because you are sure (or you don't pay attention) 
that would ask you to confirm.
Since i read that article (it was on a magazine), i try to don't use 
this kind of aliases and to pay more attention on what i'm doing.
I found what i was really meaning:
http://unix.about.com/library/weekly/aa020501c.htm
Pier

--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Restoring /etc/inittab

2004-05-13 Thread Pierg75
Adam Funk wrote:
On Wednesday 12 May 2004 17:40, Pierg75 wrote:
Somewhere i read that an alias should never be an alias of itself,
something like alias rm='rm -i'
alias ls='ls --color=auto'
alias rm='rm -vi'
alias cp='cp -vi'
alias mv='mv -vi'
alias cal='cal -3m'  # week starts on Monday
and I'm sure I got this idea from some reputable Unix books.  This way
rm always asks *except* when you use -f.
It works for sure, because somewhere i use it too.
I was meaning about the comcept:
because if you get use of this approach, when you go to work on a 
machine that doesn't have this alias, immagine what you coul do if you 
write rm /etc/apache/* because you are sure (or you don't pay 
attention) that would ask you to confirm.
Since i read that article (it was on a magazine), i try to don't use 
this kind of aliases and to pay more attention on what i'm doing.
;-)

PIer

--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Restoring /etc/inittab

2004-05-12 Thread Adam Funk
On Wednesday 12 May 2004 17:40, Pierg75 wrote:

> Monique Y. Mudama wrote:
>> Um, no, you haven't.  If rm is aliased to 'rm -i' in root's
>> environment,
>> it should have prompted.  Unless he neglected to mention that he
>> actually did 'rm -rf' ...
> 
> Somewhere i read that an alias should never be an alias of itself,
> something like alias rm='rm -i'

I'm fairly certain that's not the case, because I do it all the time! 
Examples from by ~/.bashrc:

alias ls='ls --color=auto'
alias rm='rm -vi'
alias cp='cp -vi'
alias mv='mv -vi'
alias cal='cal -3m'  # week starts on Monday

and I'm sure I got this idea from some reputable Unix books.  This way
rm always asks *except* when you use -f.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Restoring /etc/inittab

2004-05-12 Thread Colin Watson
On Wed, May 12, 2004 at 06:32:54PM +0200, Pierg75 wrote:
> Monique Y. Mudama wrote:
> >Um, no, you haven't.  If rm is aliased to 'rm -i' in root's environment,
> >it should have prompted.  Unless he neglected to mention that he
> >actually did 'rm -rf' ...
> 
> Somewhere i read that an alias should never be an alias of itself,
> something like alias rm='rm -i'

Whatever you read was wrong; a word is not expanded as an alias if it is
identical to an alias currently being expanded.

Cheers,

-- 
Colin Watson  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Restoring /etc/inittab

2004-05-12 Thread Pierg75
Monique Y. Mudama wrote:
Um, no, you haven't.  If rm is aliased to 'rm -i' in root's environment,
it should have prompted.  Unless he neglected to mention that he
actually did 'rm -rf' ...
Somewhere i read that an alias should never be an alias of itself,
something like alias rm='rm -i'
Pier

--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]