Bash configuration: Difference between revisions

From wikinotes
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Bash is configured in <code>~/.bashrc</code>. Any environment variables or functions you define here will be available in your interactive shell environment.
Bash is configured in <code>~/.bashrc</code>. Any environment variables or functions you define here will be available in your interactive shell environment.
= Documentation =
<blockquote>
{| class="wikitable"
|-
| <code>set</code> docs || https://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin
|-
|}
</blockquote><!-- Documentation -->


= Set Options =
= Set Options =
<blockquote>
<blockquote>
You can set bash option
See docs https://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin
* <code>-${flag}</code> set option
* <code>-${flag}</code> set option
* <code>+${flag}</code> unset option
* <code>+${flag}</code> unset option

Latest revision as of 13:06, 13 August 2021

Bash is configured in ~/.bashrc. Any environment variables or functions you define here will be available in your interactive shell environment.

Documentation

set docs https://www.gnu.org/software/bash/manual/bash.html#The-Set-Builtin

Set Options

  • -${flag} set option
  • +${flag} unset option
# examples
set -e            `# exit if any pipe/command fails` \
set -o  pipefail  `# pipe exitcode is last pipe in pipeline to exit w/ failure` \

vi mode

set -o vi
bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'