Q: Deleting files without confirmation

Q: Deleting files without confirmation

Post by Niels C. Schmid » Fri, 31 May 1996 04:00:00



I have a problem concerning the deletion of files on SunOS.

Whenever I try to remove a file I am asked: 'rm: remove <file>?
This is regardless of the access mode of the file and even though I am
the owner.

I'm also certain that the shell variable 'noclobber' is *not* set (if
that would have any affect, anyway).

Furthermore, not even 'rm -f' affects this situation - I still have to
confirm the deletion of the file(s).

Therefore: Is there any shell (or environment) variables that could
result in this problem ??

Thanks in advance

Niels Schmidt

 
 
 

Q: Deleting files without confirmation

Post by Niels C. Schmid » Fri, 31 May 1996 04:00:00



Quote:>I have a problem concerning the deletion of files on SunOS.

>Whenever I try to remove a file I am asked: 'rm: remove <file>?
>This is regardless of the access mode of the file and even though I am
>the owner.

>I'm also certain that the shell variable 'noclobber' is *not* set (if
>that would have any affect, anyway).

>Furthermore, not even 'rm -f' affects this situation - I still have to
>confirm the deletion of the file(s).

>Therefore: Is there any shell (or environment) variables that could
>result in this problem ??

>Thanks in advance

>Niels Schmidt

No need to answer. The question was answered elsewhere by Kevin Johnson
and my problem *was* caused by an alias: alias rm rm -i.

Hmmmh - why didn't I think of that ???

Thanks

 
 
 

Q: Deleting files without confirmation

Post by Sam Sexto » Wed, 05 Jun 1996 04:00:00


Quote:Niels C. Schmidt writes:
>Whenever I try to remove a file I am asked: 'rm: remove <file>?
>This is regardless of the access mode of the file and even though I am
>the owner.

>Furthermore, not even 'rm -f' affects this situation - I still have to
>confirm the deletion of the file(s).

>Therefore: Is there any shell (or environment) variables that could
>result in this problem ??

Yes - you will doubtless have an alias setting rm to "rm -i" - the
effect of this will persist with use of additional flags. Unless you
want to unset the alias, the answer is to nullify it: \rm file.

--
Sam Sexton                                           (+44|0)1203 256562
Reuters Ltd                                            
Coventry, UK

 
 
 

Q: Deleting files without confirmation

Post by Brian Duan » Wed, 05 Jun 1996 04:00:00



> I have a problem concerning the deletion of files on SunOS.

> Whenever I try to remove a file I am asked: 'rm: remove <file>?
> This is regardless of the access mode of the file and even though I am
> the owner.
> You probably have an alias that equates rm to 'rm -i'

To verify this, run the 'alias' command.
To cancel the alias for rm, run the 'unalias rm' command.
--
Brian Duane - NCR Corporation
(Formerly AT&T GIS, formerly NCR)

 
 
 

Q: Deleting files without confirmation

Post by Jack Russe » Thu, 06 Jun 1996 04:00:00




Quote:>I have a problem concerning the deletion of files on SunOS.

>Whenever I try to remove a file I am asked: 'rm: remove <file>?
>This is regardless of the access mode of the file and even though I am
>the owner.

Check to make sure the `rm` command isn't aliased somewhere to `rm -i`.

Using the full path of the executable will work of course, since you
will be bypassing any alias for the word "rm".

--------------------------------------------------------------------------
Russ Russell, UNIX Consultant        "A tout le monde, a tout les amis"

Sequoia Diversified Products  8100 River Drive, Morton Grove, IL

 
 
 

Q: Deleting files without confirmation

Post by STEVEN RIG » Thu, 06 Jun 1996 04:00:00


NS>I have a problem concerning the deletion of files on SunOS.

NS>Whenever I try to remove a file I am asked: 'rm: remove <file>?
  >This is regardless of the access mode of the file and even though I am
  >the owner.

It sounds as though your admin has set you an alias to rm. You don't
mention which shell you're using, if it's csh check your .login, if
it's ksh check ypur .profile.

You should be able to get round this by using the absolute path for rm,
probably /bin/rm (I don't use Sun so not I'm not certain) this will
skip the alias and use the 'proper' rm command.

Bye for now

Steve

 * 1st 2.00 ~ Real men don't set phasers on stun...

 
 
 

Q: Deleting files without confirmation

Post by Aaron R. Kulki » Fri, 07 Jun 1996 04:00:00




Quote:>I have a problem concerning the deletion of files on SunOS.

>Whenever I try to remove a file I am asked: 'rm: remove <file>?
>This is regardless of the access mode of the file and even though I am
>the owner.
>   ..............stuff deleted..........
>Furthermore, not even 'rm -f' affects this situation - I still have to
>confirm the deletion of the file(s).

>Niels Schmidt

If you are running csh or tcsh, then in your .cshrc (or, hopefully not,
your .login) is the following line:

alias   rm      /bin/rm -i
or
alias   rm      rm -i

the -i means for 'interactive' or 'interrogate' (your pick).

change it to
#alias rm       /bin/rm -i
(Makes it a comment, in case you decide you want it back later,
since you sound kinda newbie to Unix)

if your are running sh, ksh, or bash, then look in .profile (and/or
kshrc) for a similar line.  The main thing is that their is
a mapping of 'rm' to 'rm -i' in one of those four files.  Find
it and comment it out

Aaron R. Kulkis
Unix Systems Administrator
EDS/GM Powertrain
Warren Technical Center, Warren, Mich

 
 
 

Q: Deleting files without confirmation

Post by Phil Edwar » Fri, 07 Jun 1996 04:00:00


[cc'd to poster]



+ Check to make sure the `rm` command isn't aliased somewhere to `rm -i`.
+
+ Using the full path of the executable will work of course, since you
+ will be bypassing any alias for the word "rm".

[Un?]fortunately,

        alias /bin/rm "rm -i"

works.

Luck++;
Phil

--

                                    The gods do not protect fools.  Fools are
                                protected by more capable fools. -Larry Niven

 
 
 

Q: Deleting files without confirmation

Post by Justin C Llo » Sun, 09 Jun 1996 04:00:00


: Yes - you will doubtless have an alias setting rm to "rm -i" - the
: effect of this will persist with use of additional flags. Unless you
: want to unset the alias, the answer is to nullify it: \rm file.

So this nullifying works, but what exactly is happening?  I've never seen
anything about this in the books that I've read.

JcL
--

%%%  in the face of the blinding sun i wake  :     Sarah McLachlan     %%%
%%%  only to find that heaven is a stranger  :     -- Drawn to --      %%%
%%%  place than the world i've left behind   :     - the Rhythm -      %%%

 
 
 

Q: Deleting files without confirmation

Post by Richard Sto » Tue, 11 Jun 1996 04:00:00





>: Yes - you will doubtless have an alias setting rm to "rm -i" - the
>: effect of this will persist with use of additional flags. Unless you
>: want to unset the alias, the answer is to nullify it: \rm file.

>So this nullifying works, but what exactly is happening?  I've never seen
>anything about this in the books that I've read.

The "\" tells the shell to interpret the first character 'r' as a
literal string.  This has the side effect of turning off alias
substitution for that particular entry line.  The permanent solution
is to remove or comment out the alias line in your .login or .cshrc.

Another * is to pop into another shell for the delete cycle,
then exit back out to csh.  Just type "sh", then do your business, and
then "exit".

Rich