Operating System - HP-UX
1752584 Members
3829 Online
108788 Solutions
New Discussion

Re: problem after rm -rf *

 
SOLVED
Go to solution
Stephen Keane
Honored Contributor

Re: problem after rm -rf *

The best one I've seen to date, run as root in a script designed to "trim" a log file directory.

...
export LOG_DIR="blah"
...

cd $LGO_DIR
rm -fr *.*


Patrick Wallek
Honored Contributor

Re: problem after rm -rf *

That is precisely why one should always put a 'set -u' in scripts. That way the script would error out before doing the 'rm'.