Re: OT - Getting fired for database oops

From: Tony van Lingen <tony_vanlingen_at_technologyonecorp.com>
Date: Tue, 19 May 2009 09:47:31 +1000
Message-ID: <4A11F393.3000700_at_technologyonecorp.com>



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

[lingent_at_T1W101955][19/05/2009 09:38:18][~/test] $ alias rm
alias rm='/bin/rm -i'
[lingent_at_T1W101955][19/05/2009 09:38:23][~/test] $ rm tralal
/bin/rm: remove regular empty file `tralal'? n [lingent_at_T1W101955][19/05/2009 09:38:29][~/test] $ rm -f tralal
[lingent_at_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
>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon May 18 2009 - 18:47:31 CDT

Original text of this message