O
O
Oleg2017-08-23 13:01:41
bash
Oleg, 2017-08-23 13:01:41

How to understand alias escaping in bash?

In .bashrcI have a comment before the alias examples:

# Some example alias instructions
# If these are enabled they will be used instead of any instructions
# they may mask.  For example, alias rm='rm -i' will mask the rm
# application.  To override the alias instruction use a \ before, ie
# \rm will call the real rm not the alias.

The "bash Cookbook" also talks about this way of running real programs, not aliases.
But man bashthis is not clearly stated. All I found was "A non-quoted backslash '\' is the Bash escape character. It preserves the literal value of the next character that follows, with the exception of newline."
How does storing the literal meaning of a single character disable the use of an alias?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xp3, 2017-08-24
@hobo-mts

The text you cited about the backslash from the "quoting" section and "saving the literal value of one character" in the command shell has nothing to do with it, only with strings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question