maio
[h2N7SspZmY.git] / data / pages / bash.txt
blob9b7bea0473043e738c73ebb197de4520cb176887
1 ====== Bash ======
3 ===== How to change escape characters association =====
5 Sometimes you can't send a program some characters association (e.g. Ctrl+S) because the bash window intercepts then. In order to the program to work correctly, you must remove this character association from bash. Here is an example:
7 <code bash>
8 # see escape characters association
9 $ stty -a
10 # shows ... ; stop = ^S; ...
11 # let's associate stop to Ctrl+Q
12 $ ssty stop ^Q
13 # now CTRL-S will be passed to the program running inside the bash
14 </code>
16 ===== How to change bash configuration =====
18 The file ~/.bashrc is read and executed every time you open bash. So if you want that a configuration change (like stty) to be true the next time you open bash, you must append it to the ~/.bashrc. Here is an example code:
20 <code bash>
21 # append to ~/.bashrc
22 $ echo 'stty stop ^Q' >> ~/.bashrc
23 </code>
25 ===== How to use same bash configuration file on many PCs =====
27 If order to use the same configuration file on many PCs (e.g. your work and you home), you can include your main file on the ~/.bashrc of those PCs. Example:
29 <code bash>
30 # append to ~/.bashrc (do this on each PC)
31 $ echo 'source /path/to/your/main/configuration/file/.bashrc' >> ~/.bashrc
32 </code>