View previous topic :: View next topic |
Author |
Message |
Krog Guru
Joined: 26 Jun 2007 Posts: 339 Location: Roma, Italy
|
Posted: Mon Aug 22, 2016 7:10 pm Post subject: rm -rf keeps asking confirmation |
|
|
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 |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Mon Aug 22, 2016 7:18 pm Post subject: |
|
|
type:
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 |
|
|
1clue Advocate
Joined: 05 Feb 2006 Posts: 2569
|
Posted: Mon Aug 22, 2016 7:20 pm Post subject: |
|
|
That said, why would you want to clean out distfiles? |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Mon Aug 22, 2016 8:13 pm Post subject: |
|
|
Use eclean-dist. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Mon Aug 22, 2016 8:17 pm Post subject: |
|
|
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 |
|
|
Krog Guru
Joined: 26 Jun 2007 Posts: 339 Location: Roma, Italy
|
Posted: Wed Aug 24, 2016 9:49 am Post subject: |
|
|
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 |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Wed Aug 24, 2016 10:10 am Post subject: |
|
|
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 |
|
|
Krog Guru
Joined: 26 Jun 2007 Posts: 339 Location: Roma, Italy
|
Posted: Wed Aug 24, 2016 10:16 am Post subject: |
|
|
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 |
|
|
Chiitoo Administrator
Joined: 28 Feb 2010 Posts: 2687 Location: Here and Away Again
|
Posted: Thu Aug 25, 2016 1:22 pm Post subject: ><)))°€ |
|
|
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 |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9779 Location: almost Mile High in the USA
|
Posted: Thu Aug 25, 2016 2:39 pm Post subject: |
|
|
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 |
|
|
|