This is the mail archive of the
mailing list for the Cygwin project.
Re: /bin/ gets deleted on error
On 2017-04-13 12:01, Dan Kegel wrote:
>>> For the second time this week my /bin/ folder gets obliterated on an
>>> error during normal usage. It is equivalent of doing the infamous "rm
>>> -rf /bin" .
> What were you doing immediately before the directory disappeared?
> I have only had things like this happen from user error,
> e.g. scripting mistakes.
> (The first time I saw somebody rm -rf / was in 1980 :-) )
BTDT a few times!
Easy to do with a typo in a script variable name e.g.
rm -fR $fopdir/
or running a script with a typo that leaves a variable undefined;
defensive coding is your friend to avoid disasters:
if [ -n "$foodir" ] && [ -d $foodir/ ]; then
/bin/rm -fR -- $foodir || exit
echo "Can't find directory '$foodir'"
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple