Mailinglist Archive: opensuse (924 mails)

< Previous Next >
Re: [opensuse] Re: add prompt to rm command
David Haller said the following on 10/18/2012 07:06 AM:

As per Murphy, you'll "accidentally" remove the only existing copy of
your most important file WHEN (not if!) that alias is not set for
whatever reason,

As per the BASH man page, there is the ~/.bashrc personal initialization
file which is sourced for each interactive shell
that is started.

<quote>
When an interactive shell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists. This
may be inhibited by using the --norc option. The --rcfile file option
will force bash to read and execute commands from file instead of
~/.bashrc.

When bash is started non-interactively, to run a shell script, for
example, it looks for the variable BASH_ENV in the environment, expands
its value if it appears there, and uses the expanded value as the name
of a file to read and execute. Bash behaves as if the following
command were executed:
if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi

</quote

Nothing is idiot-proof (and there is a long line of ever more idiotic
idiots waiting to prove that) but therein is the OPs answer to "make it
permanent". He can set BASH_ENV and the contents of ~/.bashrc to ensure
that the alias *IS* set whenever he has an interactive shell.

Perphas a shell function might be better than an alias :-)

Really: DO NOT ALIAS 'rm' TO 'rm -i'. EVER.

THINK before you type and hit enter.

I really don't like absolutes, except for a few physical constants.
Religious zealots may have their own set of absolutes they believe in,
but that isn't applicable here either.

Perhaps we should reconsider the use of the term 'permanent' as well :-)

--
I thought about being born again, but my mother refused.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups