1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
Bash Configuration for Debian
-----------------------------
A number of patches for the bash sources is applied for the Debian build
of bash. See the details at the end of the file.
The bash package was built using the following configuration options:
--with-curses \
--disable-net-redirections \
--enable-largefile \
bash-static additionally configured with --enable-static-link, bash-minimal
configured with --enable-minimal-config --enable-largefile.
A kind of FAQ for bash on Debian GNU/{Linux,Hurd}
-------------------------------------------------
0. symlinked directory completion behavior
Starting with readline-4.2a, completion on symlinks that point
to directories does not append the slash. To restore the behaviour
found in readline-4.2, add to /etc/inputrc or ~/.inputrc:
set mark-symlinked-directories on
1. How can I make /bin/sh point to something else?
Type
dpkg-divert --add /bin/sh
and then point it to whatever you want. Upgrades to bash won't upgrade
the /bin/sh symlink. To put /bin/sh under dpkg control again, type
dpkg-divert --remove /bin/sh
2. How can I make bash 8-bit clean so I can type hi-bit characters
directly?
Remove the comments from the indicated lines in /etc/inputrc.
It doesn't ship this way because otherwise the Meta bindings will not work.
3. How to get rid off annoying beeps for ambiguous completions?
Put in /etc/inputrc (or in your ~/.inputrc):
set show-all-if-ambiguous on
Other people prefer:
set bell-style none
4. bash doesn't display prompts correctly.
When using colors in prompts (or escape characters), then make sure
those characters are surrounded by \[ and \]. For more information
look at the man page bash(1) and search for PROMPTING.
5. What is /etc/bash.bashrc? It doesn't seem to be documented.
The Debian version of bash is compiled with a special option
(-DSYS_BASHRC) that makes bash read /etc/bash.bashrc before ~/.bashrc
for interactive non-login shells. So, on Debian systems,
/etc/bash.bashrc is to ~/.bashrc as /etc/profile is to
~/.bash_profile.
6. bash does not check $PATH if hash fails
bash hashes the location of recently executed commands. When a command
is moved to a new location in the PATH, the command is still in the PATH
but the hash table still records the old location.
For performance reasons bash does not remove the command from the hash
and relook it up in PATH.
Use 'hash -r' manually or set a bash option: 'shopt -s checkhash'.
7. Bourne-style shells have always accepted multiple directory name arguments
to cd. If the user doesn't like it, have him define a shell function:
cd()
{
case $# in
0|1) ;;
*) echo "cd: too many arguments ; return 2 ;;
esac
builtin cd "$@"
}
8. key bindings for ESC
Consider the following .inputrc:
set editing-mode vi
keymap vi
"\M-[D": backward-char
"\M-[C": forward-char
"\M-[A": previous-history
"\M-[B": next-history
And, just to be certain, set -o reports that vi is on.
However, ESC k does not send me to the previous line.
I'm guessing that this is a conflict between bash's concept of a meta
keymap and its concept of vi's command-mode character -- which is to
say that its data structures don't properly reflect its implementation.
Note that if I remove the meta prefix, leaving lines like:
"[A": previous-history
That vi command mode keys work fine, and I can use the arrow keys in vi
mode, *provided I'm already in command mode already*. In other words,
bash is doing something wrong here such that it doesn't see the escape
character at the beginning of the key sequence even when in vi insert mode.
Comment from the upstream author: "This guy destroyed the key binding for
ESC, which effectively disabled vi command mode. It's not as simple as he
paints it to be -- the binding for ESC in the vi insertion keymap *must*
be a function because of the other things needed when switching
from insert mode to command mode.
If he wants to change something in vi's command mode, he needs
to use `set keymap vi-command' and enter key bindings without
the \M- prefix (as he discovered)."
9. Why is bash configured with --disable-net-redirections?
It can produce completely unexpected results. This kind of
feature should not be part of a shell but a special. tool. And
that tool has existed for years already, it's called netcat.
Patches Applied to the Bash Sources
-----------------------------------
|