Thursday, June 4, 2015

Short memo of bash functions.

Bash - colors for console

Bash memo.




Functions

Optional

Syntax:
function functionName {
  passedArg1=$1
  passedArg2=$2

  local resultValue='Result value'
  echo "$resultValue"
}

returnedValue=$(functionName arg1 arg2)


Colors


echo -e "\e[1;34mThis is a blue text.\e[0m"



AttributeColorBgColor
00 - none30 - black40 - black
01 - bold31 - red41 - red
32 - green42 - green
33 - yellow43 - yellow
04 - underscore34 - blue44 - blue
05 - blink35 - magenta45 - magenta
36 - cyan46 - cyan
07 - reverse37 - white47 - white
08 - concealed


No comments:

VIM cheat sheet

Basic basics :) i - start editing, current symbol a - start editing, next symbol Esc - stop editing :w - write to disk :w <filename> -...