Did you ever wonder why bash in Oracle Linux, Red Hat Enterprise Linux and other recent Linuxes escapes the dollar sign ($) when completing paths with the tabulator (tab) key like that:
[oracle@oratest01 ~]$ (KLM12102) ls -l \$ORACLE_BASE/diag
In bash >= 4.2.29 you have a “direxpand” option, which is NOT set by default. The bash manual explains it this way:
If set, bash replaces directory names with the results of word expansion when performing filename completion. This changes the contents of the readline editing buffer. If not set, bash attempts to preserve what the user typed.
Set this option with
shopt -s direxpand
For example in your profile or wherever you feel it is useful.
Bye and be careful, as usual
One thought on “Oracle Enterprise Linux 7: How to stop bash tab completion from escaping the dollar $”
Thanks a lot ! This was driving me crazy !