On 10/18/2012 8:18 AM, Anton Aylward wrote:
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
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 :-)
When he is on any other machine but his own, or his own after an update, or his own when under some other user account, or his own when in some other shell, or his own when writing a non-interactive script that may also not run under his user environment (cgi, cron, init, etc), "rm" will behave like "rm" and no like he had trained himself to think that rm behaves. Antons advice is 100% correct and it's irresponsible to help users do things wrong. -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org