Reece Dunn wrote:

I use a perl script that does the same thing as:

   cd /build
   tar -xf /packages/$PACKAGE/$PACKAGE-$VERSION.tar.*
   cd `ls`

   /packages/$PACKAGE/$PACKAGE # run the build script

   cd /build
   rm -r *

This is very dangerous and should be avoided at all costs.
One should never really do 'rm -r *'. If for whatever reason
the 'cd /whatever' fails, and you are in the root of the
directory tree, you are hosed. Your system is now unusable.

The proper thing is to do something such as 'rm -r /build/*'.
That way, you never risk the possibility that something goes
wrong.

If one is in the habit of using 'rm -r *'. It is just a matter
of time until catastrophe happens. Trust me.

Reminds me of when I did 'rm -r t*' once. Only problem is that
I didn't type the 't' correctly, instead it came out as
'rm -r *' in the root of my build directory. Of course, I'm
confident I typed things right, so I didn't look at the command
before hitting 'Enter'. Guess what?

Luckily, this was after I started using Subversion to archive
my build scripts. That just means I lost a bunch of sources and
log files. Not a big deal. Could have been disaster.

Moral is:

Never, ever use 'rm -r *' unless you are double certain you are
in the directory you think you are in. That includes double
ensuring things before hitting the 'Enter' key. That includes also
ensuring that you are on the *host system* you think you are.
Another thing I've done before, issue a 'rm -r g*', only thing
was, I was on a different host than I thought I was.

If you use 'rm -r *', it is only a matter of time 'till a screwup.

===============================================
Back up often, and test your backups regularly!
===============================================

--
Randy

--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to