Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rm -rf keeps asking confirmation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Krog
Guru
Guru


Joined: 26 Jun 2007
Posts: 339
Location: Roma, Italy

PostPosted: Mon Aug 22, 2016 7:10 pm    Post subject: rm -rf keeps asking confirmation Reply with quote

Hi all
i have my dumb script to update my gentoo box that contains the command:
Code:
rm -rf /usr/portage/distfiles/*

i tried both "rf" and "fr" but it keeps asking confirmation... how is that possible?
the option -f should prevent any confirmation!
am I missing something?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Mon Aug 22, 2016 7:18 pm    Post subject: Reply with quote

type:
Code:
alias rm


If you have rm aliased to something containing an -i or an --interactive=always then it will ask for each file even with an -f.

Otherwise you may not have permission to remove some of the files.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Mon Aug 22, 2016 7:20 pm    Post subject: Reply with quote

That said, why would you want to clean out distfiles?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Mon Aug 22, 2016 8:13 pm    Post subject: Reply with quote

Use eclean-dist.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Mon Aug 22, 2016 8:17 pm    Post subject: Reply with quote

aliases should not affect shellscripts, they would break/endanger too many scripts otherwise.

maybe rm is not what you believe it to be? maybe it's an ask-for-confirmation script you once installed and forgot.
Back to top
View user's profile Send private message
Krog
Guru
Guru


Joined: 26 Jun 2007
Posts: 339
Location: Roma, Italy

PostPosted: Wed Aug 24, 2016 9:49 am    Post subject: Reply with quote

no aliases here...
another test:

Code:
krogpc krog # mkdir test
krogpc krog # mkdir test/test
krogpc krog # touch test/test/1
krogpc krog # rm -fr test/*
zsh: sure you want to delete all the files in /home/krog/test [yn]? n
krogpc krog # rm -fr test
krogpc krog #

it seems rm -fr something/* asks confirmation, rm -fr something no... a bug?
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Wed Aug 24, 2016 10:10 am    Post subject: Reply with quote

zsh: may point to this being a zsh thing

see if it happens in bash

if not then dig into that zsh manpage
Back to top
View user's profile Send private message
Krog
Guru
Guru


Joined: 26 Jun 2007
Posts: 339
Location: Roma, Italy

PostPosted: Wed Aug 24, 2016 10:16 am    Post subject: Reply with quote

frostschutz wrote:
zsh: may point to this being a zsh thing

see if it happens in bash

if not then dig into that zsh manpage


you were right, it's some zsh thing.
with bash the problem is not present.
thanks!
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2588
Location: Here and Away Again

PostPosted: Thu Aug 25, 2016 1:22 pm    Post subject: ><)))°€ Reply with quote

Indeed, one SpaceToast at #gentoo-chat of freenode mentioned that “they have the NORMSTARSILENT option enabled”.

I'm guessing this from the manual:

Code:
RM_STAR_SILENT (-H) <K> <S>
Do not query the user before executing ‘rm *’ or ‘rm path/*’.

_________________
Kindest of regardses.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9696
Location: almost Mile High in the USA

PostPosted: Thu Aug 25, 2016 2:39 pm    Post subject: Reply with quote

tcsh has the same "problem" by default when you try to rm *...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum