Re: OT - Getting fired for database oops

  • From: Tony van Lingen <tony_vanlingen@xxxxxxxxxxxxxxxxxxxxx>
  • To: oracle-l-freelists <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 19 May 2009 09:47:31 +1000

Of course, using GNU rm the -f option overrides the -i... On a Ubuntu
system:

[lingent@T1W101955][19/05/2009 09:38:18][~/test]
$ alias rm
alias rm='/bin/rm -i'
[lingent@T1W101955][19/05/2009 09:38:23][~/test]
$ rm tralal
/bin/rm: remove regular empty file `tralal'? n
[lingent@T1W101955][19/05/2009 09:38:29][~/test]
$ rm -f tralal
[lingent@T1W101955][19/05/2009 09:38:33][~/test]
$

There's no one-size-fits-all solution in a *NIX environment.. ;)

Cheers,
Tony

Jared Still wrote:
Yup, you're right on that, I just tested it.

The -i file trick will prevent command line snafu's
such as 'rm -rf'.

In the case of '-r' it causes rm to ask:
rm: descend into directory `a'?

When used with find | xargs rm however, the '-i' is not passed.

I tried with '-exec rm {]\;' but that no longer seems to work.

Dunno if the syntax has changed, or what.

jkstill-2 > find .  -exec 'rm -rf' {}\;
find: missing argument to `-exec'
[ /home/jkstill/tmp/rm_test ]

jkstill-2 > find .  -exec 'rm ' {}\;
find: missing argument to `-exec'


Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
//www.freelists.org/webpage/oracle-l


Other related posts: