Re: Why people use `find ... |env -i xargs rm -f' instead of `find ...| xargs rm -f'?
On Wed 12 Mar 2003 15:15:33 +0000(+1100), Michael Wardle wrote:
> On Wednesday, March 12, 2003 14:45, Dai Yuwen wrote:
> > Why people want to clean the environment variables before rm files?
>
> Some systems have an alias for "rm" that invokes "rm -i". It's possible that
> running with env -i ensures that the true, unaliased command is run.
I don't think that's it. Aliases aren't in the environment and env won't invoke a shell (to create new aliases) implicitly.
I guess that the purpose of 'env -i' is to clear the PATH to avoid custom versions of 'rm'.
In order to find the official rm, env would need to supply a default PATH, presumably using execlp/execvp.
--
Cheers,
Clive
Reply to: