When will os.remove fail?

Chris Angelico rosuav at gmail.com
Tue Mar 14 10:26:48 EDT 2017


On Wed, Mar 15, 2017 at 1:22 AM, Frank Millman <frank at chagford.com> wrote:
> "Chris Angelico"  wrote in message
> news:CAPTjJmrim9TJHfOLgynUJATx_HkVXXQ_D8YJPkX8Y32qHCzzFw at mail.gmail.com...
>
> On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens <jon+usenet at unequivocal.eu>
> wrote:
>>>>
>>>>
>>>> (And the rm command won't ask if you say "-f".)
>>>
>>>
>>> rm does not ask before deleting. However some Linux distributions
>>> take it upon themselves to put "alias rm='rm -i'" in /etc/profile.
>>
>>
>> I have no such alias, but it still prompts.
>>
>
> On Fedora 22 (and for many previous versions) I have noticed that, if I log
> in as 'root', it does prompt, but if I log in as an ordinary user, it does
> not.
>
> If I type 'alias' at the console, it lists current aliases. 'root' shows
> exactly what Jon quoted above. 'frank' shows no alias for 'rm'.
>
> I had a quick look to see what was setting it, but there is nothing in
> /etc/profile or in /etc/bashrc. I don't know where else to check.

Since root has the prompt, check /root/.profile and /root/.bashrc.
There may also be other files sourced from either of those, eg
/root/.bash_aliases.

ChrisA


More information about the Python-list mailing list