Notes:bash

From Maths
Jump to: navigation, search



TODO: Investigate monospace or tt in the displaytitle or something.... it's bad


Purpose

I keep forgetting stuff about bash, but I don't have enough to start making a reference, hence a notes page!

Goals

  • Use exit status of previous command to influence the prompt shown when it completes, so I have some visual indication of error
  • Fix history so it actually works across multiple prompts, this might involve using PROMPT_COMMAND

Special variables

alphabetical list:

  • PROMPT_COMMAND - run this before a prompt is displayed - not after every command
    • If it were after every command it'd be run constant during stages of a pipeline and in scripts. It only runs BEFORE a prompt for command is shown
  • PROMPT_DIRTRIM=[ilmath]n[/ilmath] - controls how many directory levels are shown by the prompt
    • set to [ilmath]n[/ilmath]=zero for default behaviour (show cwd, with ~ for home directory)
    • otherwise show only [ilmath]n[/ilmath] levels