On Fri, Oct 17, 2014 at 5:16 PM, Superingo <[email protected]> wrote:
>> Your proposal is not going to solve your problem.
>> You are not trying to tell me that you plan to type 'rm -x'
>> for each and every removal in the future, right?
>> And even if you do plan on doing that, it's easy to forget.
>
> I considered "alias rm='rm -x'" in a profile, and planned to remember adding
> -f when needed.
If you're going to hack your profile already, you might as well just
implement the logic there, so that it works on all the systems you
carry that profile to instead of only those where rm has been hacked:
function rm {
local rmopts arg
for arg
do
case $arg in
-*) set -A rmopts -- "${rmopts[@]}" "$arg";;
*) command rm "${rmopts[@]}" "$arg" || return;;
esac
done
}
Philip Guenther