Re:Use long flags when scripting (2013)
by jrimbault on Friday September 18, 2020 @03:39PM
(#24521049)
You must have an alias rm='rm -i' lying around. rm doesn't prompt by default (unless you're the owner of the dir, but not its contents).
[ Parent
| on HN ]
IIRC 'rm -r' prompts by default for read-only files as well even if you own them.
Re:Use long flags when scripting (2013)
by jfrunyon on Friday September 18, 2020 @04:18PM
(#24521453)
... huh. No, no alias, I just misread the manpage.
I could've sworn that -I was the default......
It's a common thing for IT departments or people making enterprise images to put in because they think it makes it safer.
I feel it does more harm than good by normalising rm -f when you want to recursively delete a folder, but with CD deployments these days it's less of a deal.
Re:Use long flags when scripting (2013)
by mandelbrotwurst on Saturday September 19, 2020 @01:11AM
(#24525297)
"CD deployments" - Ha, like an "ATM machine"? At first in thought you were describing deployments on compact discs!
Re:Use long flags when scripting (2013)
by ninjanomnom on Saturday September 19, 2020 @03:41AM
(#24525864)
CD, continuous deployment, is used to refer to the process not an individual instance like the term ATM. Simply saying "This deployment failed" doesn't convey that it's a deployment that was made through CD but "This CD failed" is also ambiguous as it doesn't indicate whether the process or the conditions particular to a deployment that caused it to fail. Using them both in combination like "CD deployment" seems perfectly valid to me to resolve both ambiguities.
To be fair though they were referring to CD deployment(s), plural, which is a bit redundant and just CD would have done just as well in this case.
Re:Use long flags when scripting (2013)
by jfrunyon on Friday September 18, 2020 @04:40PM
(#24521676)
Yeah... no. Also definitely not the case. If I actually am remembering it correctly then it's probably from Fedora circa FC5 or Ubuntu circa 6.06. Back when I was in school and had never touched Linux other than on my own computer.
Go do a fresh install of CentOS/RHEL (or just spin up a new docker container) and what do you see in root's bashrc?
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
I've also encountered one job which adds this to their base ubuntu image, and my current employer uses Macs which have it added to bashrc by their mdm software on initial install.So what's your justification to dismiss the idea that this is a common practice?
Re:Use long flags when scripting (2013)
by matthewbauer on Friday September 18, 2020 @05:01PM
(#24521854)
Aliases shouldn't be run in non-interactive shells IIRC.
Re:Use long flags when scripting (2013)
by jfrunyon on Tuesday September 22, 2020 @12:12AM
(#24550758)
I wasn't dismissing the idea that it was common practice, I was dismissing the idea that the common practice applied in my case. I did not have an IT department setting anything on my system when I experienced this.
Thank you for the info, though.